Using an session bean to get a connection from a DataSource and execute
an SELECT SEQ_NAME.nextval FROM DUAL query.
 
I get an exception like:
 Table not found: DUAL in statement [SELECT ALRT_SEQ.nextval FROM DUAL]
     at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRem
oteCall.java:245)
     at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220
)
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
     at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unkno
wn Source)


I am connecting to an Oracle 8i DB 
jboss.jcml:
  <mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
     <attribute name="Drivers">oracle.jdbc.driver.OracleDriver,
org.hsqldb.jdbcDriver</attribute>
  </mbean>

  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=OracleDS">
    <attribute name="PoolName">OracleDS</attribute>
    <attribute
name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</
attribute>
    <attribute name="Properties"/>
    <attribute
name="URL">jdbc:oracle:thin:@oracle-4:1521:saturnsring</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">USER_NAME</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password">password</attribute>
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">2</attribute>
  </mbean>

In the EJB I am getting the DataSource using:
dataSource =
(DataSource)getJndiContext().lookup("java:comp/env/jdbc/elogexPool");
I am getting the connection by:
Connection newConnection = getDataSource().getConnection();

the jboss.xml ref desc looks like:
        <reference-descriptor>
          <resource-description>
            <res-ref-name>jdbc/elogexPool</res-ref-name>
            <jndi-name>java:/OracleDS</jndi-name>
          </resource-description>
        </reference-descriptor>

the ejb-jar.xml ref desc looks like:
         <resource-ref>
           <description></description>
           <res-ref-name>jdbc/elogexPool</res-ref-name>
           <res-type>javax.sql.DataSource</res-type>
           <res-auth>Container</res-auth>
         </resource-ref>

I have an entity bean working correctly against that DataSource for
finder methods.
 
Questions:
Is this right?
Should I be using an Oracle specific XADataSource instead of the JBoss
wrapper? 
  oracle.jdbc.xa.OracleXADataSource - the DataSource would not
start/deploy
  oracle.jdbc.xa.client.OracleXADataSource - had same problem

If anyone has this working I would love to see their deploy descriptors
(jboss, ejb-jar), lookups in the EJB, and XADataSource configuration
from the jboss.jcml
Any help would be greatly appreciated.

Thanks in advance,
Marc Stogner


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to