Title: RE: [jBoss-User] JBOSS and Oracle

I've tried the 8.1.7 drivers against the 8.1.6 database both with and without the
jboss.conf change. The end result is no difference. I've downloaded the 8.1.7 server
too, but we haven't installed it anywhere as a test.

Another user suggested that I try the OCI driver instead of the thin driver. I've
placed the following URL in my jboss.jcml file for my datasource

<attribute name="URL">jdbc:oracle:oci8:@lom</attribute>

where I previously had the following
<attribute name="URL">jdbc:oracle:thin:@atiadb:1521:lom</attribute>

But JBOSS fails to start the pool for me. I do have the Oracle client installed on
my PC (except that it is the 8.1.6 client and I was trying the 8.1.7 JDBC OCI driver.)
For fun, I'll switch back to 8.1.6 for classes12.zip to see if that makes a difference
in getting the connection pool to start. (I tried this and I was able to get the connection
established. So now it means I either have to have a pure 8.1.6 or pure 8.1.7 environment)

The OCI driver (8.1.6) did not make a difference.

As another test, we were going to try another DB server (PostGresQL) if we could find
one that claimed to have true XA support, to see if it really is an Oracle problem.

The only other issue, is that it could be something in my code. For reference here is the
code that is getting the connection from JNDI. I am turning off autocommit manually, because
I saw somewhere that the pool provided connections with autocommit ON. The two problems that
I have are this type of weird Oracle error and the problem where I basically cannot use Container
Managed Transactions because the Connection is not being properly handled by the transaction manager/
datasource logic

Basically I have two BMP Entity beans. The second one cannot be created in the DB until the first one
exists due to a FK. If the two ejbCreate methods used the same connection due to the Container Managed Transaction it would work, instead it looks as if I am getting isolated connections. The error message that I get from Oracle

is in my ejbCreate method INSERT SQL is ORA-02049: timeout: distributed transaction waiting for lock.

    protected Connection getConnection() throws SQLException
    {
        try
        {
            Context jndiContext = new InitialContext();
            DataSource ds = (DataSource)jndiContext.lookup(JNDINames.DB_POOL);
            Connection con = ds.getConnection();
            // Make sure that AUTOCOMMIT is off
            con.setAutoCommit(false);
            return con;
        }
        catch (NamingException e)
        {
            throw new EJBException("Error looking up connection pool");
        }
    }



-----Original Message-----
From: Ole Husgaard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 12:51 AM
To: jBoss
Subject: Re: [jBoss-User] JBOSS and Oracle


Hi,

If possible, please post in text instead of html.

The 8.1.6 XA drivers should work with JBoss.
Problem is, he who made it work and tested it is
no longer around.
Making the 8.1.6 XA drivers work was tricky, due
to a number of incompatibilities. This is why
you have to change jboss.properties.

I have heard that the 8.1.7 XA drivers to not have
these incompatibilities, but no confirmation. If
you can run the 8.1.7 XA drivers without the
jboss.conf change, _please_ let me know.
And some CLOB problems should be fixed in the
8.1.7 driver too.

Now, back to your problem:
1) Shouldn't happen. This is one of the reasons Sun
made the JDBC2.0 Optional Package.
2) Very strange message. I can see from the stack
trace, that this happens when the TM enlists the
connection with the transaction so that the
connection knows that future work is to be done in
the context of that transaction. But a commit is
not requested.

When looking at your configuration, I see one thing
that differs from the manual.
You have in jboss.conf:
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar,classes12.zip" CODEBASE="../lib/ext/">
Manual suggest that this be:
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar" CODEBASE="../lib/ext/">
and that classes12.zip is copied to the jboss
lib/ext directory.
Please try to see if this makes a difference.

Otherwise you have two options:
a) Try upgrading to 8.1.7 to see if this helps.
Please report your findings.
b) We get together in a debugging session to find out
what is wrong. I don't know Oracle, but I do know
the JBoss internals (in particular transactions), and
I know how an XA datasource is supposed to behave.

Hope this helps.


Best Regards,

Ole Husgaard.


"Bolt, Dave" wrote:
>
> I've noticed the recent threads on Oracle, XA Datasources, BMP, and CLOBs related problems. Particularly the threads on cursors being left open and threads timing out.

>
> I've heard that Oracle 8i's 8.1.7 release works better. Is that true?
>
> Some of the problems I've been having are:
> 1) BMP beans that are participating in a transaction are given connections that are isolated from one another. A dependent EJB fails to create because the work of the parent EJB is not visible to it.

>
> 2) If I have multiple users hit the site simultaneously and the users are doing basically read-only stuff I get the following Oracle errors.

>
> [ddc/DocumentPartMedia] java.sql.SQLException: ORA-02089: COMMIT is not allowed in a subordinate session
>
> [ddc/DocumentPartMedia]         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
> [ddc/DocumentPartMedia]         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
> [ddc/DocumentPartMedia]         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
> [ddc/DocumentPartMedia]         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
> [ddc/DocumentPartMedia]         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:738)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1313)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1232)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch(OracleStatement.java:1353)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1760)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:320)

>
> [ddc/DocumentPartMedia]         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:364)

> [ddc/DocumentPartMedia]         at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:102)
> [ddc/DocumentPartMedia]         at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1020)
> [ddc/DocumentPartMedia]         at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:593)
> [ddc/DocumentPartMedia]         at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:114)
> [ddc/DocumentPartMedia]         at org.jboss.minerva.factories.XAConnectionFactory.prepareObject(XAConnectionFactory.java:254)

>
> [ddc/DocumentPartMedia]         at org.jboss.minerva.pools.ObjectPool.getObject(ObjectPool.java:539)
> [ddc/DocumentPartMedia]         at org.jboss.minerva.datasource.XAPoolDataSource.getConnection(XAPoolDataSource.java:169)

>
> [ddc/DocumentPartMedia]         at mil.army.atsc.atia.ddc.utils.ConnectionUtils.getConnection(ConnectionUtils.java:36)

> [ddc/DocumentPartMedia]         at mil.army.atsc.atia.ddc.ejb.DocumentPartMediaEJB.ejbLoad(DocumentPartMediaEJB.java:338)

>
> [ddc/DocumentPartMedia]         at java.lang.reflect.Method.invoke(Native Method)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPersistenceManager.java:275)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:192)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:204)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:144)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:323)
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:163)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:228)

>
> [ddc/DocumentPartMedia]         at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:146)
>
> This code exception happens when my logic is calling one of the business methods on the DocumentPartMediaEJB bean, which is a BMP entity bean.

>
> I'm thinking that the problems I've been having with my BMP beans (which use both BLOBs and CLOBS) are related to the problems others are having.

>
> I'm currently using Oracle 8i 8.1.6 with the following configuration items. If I migrate to 8.1.7 will they go away???? In essence, are these problems with Oracle 8.1.6 or with my code/configuration.

>
> Here's the config stuff.
>
> jboss.jcml (Note: I have changed the user, password, and URL properties to protect the innocent)
>
>      <mbean name="DefaultDomain:service=XADataSource,name=StaffingDB">
>        <attribute name="Properties"></attribute>
>        <attribute name="URL">jdbc:oracle:thin:@server:1521:instance</attribute>
>        <attribute name="GCMinIdleTime">1200000</attribute>
>        <attribute name="JDBCUser">dbuser</attribute>
>        <attribute name="MaxSize">50</attribute>
>        <attribute name="Password">dbpassword</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">5</attribute>
>      </mbean>
>
> jboss.conf
> <MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar,classes12.zip" CODEBASE="../lib/ext/">
>     <ARG TYPE="java.lang.String" VALUE="StaffingDB">
>     <ARG TYPE="java.lang.String" VALUE="oracle.jdbc.xa.client.OracleXADataSource">
> </MLET>
>
> jboss.properties
> jboss.xa.xidclass=oracle.jdbc.xa.OracleXid
> jdbc.drivers=org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,oracle.jdbc.driver.OracleDriver
>
> I'm using all of the above, on NT with JDK 1.3
>
> Dave Bolt
> There is always bandwidth, just none for you.


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to