Hi:
        When I using bean  managed transaction with oracle-xa , I found that
it cannot execute more than once; the first time, things is right and
database is update; but if execute once again a oracle- xa-warning  and a
Geronimo exception occurs; the warning and exception is list at the end of
this mail;

        The Geronimo Version I used is 2.1.4; and oracle version is 9i;

        I have use another app-server GlassFish test the same program, and
it works well; My test program is list in the attachments:
MyStatelessSessionBean.java is the ejb, and MyServlet is a servlet call the
ejb;

        The oracle xa datasource 's plan is also list in attachments; I am
not sure about if I miss configured the datasource some-where; but The
datasource does works: I can test it and execute a query through the
Geronimo's console;

        Although the oracle 's version is older, but I doesn't thinks the
database is not compatible with Geronimo's XA process; To ensure this, I
write a simple test case  which use the Geronimo's Transaction Manager and
Oralce's XA API directly; the simple test case works well; The simple test
case is also list in the list;
         In the simple test case I doesn't use the UserTransaction but
direct use the Geronimo's TransactionManager, because when debugging the
my-application, I found the UserTransaction is provided by OpenEJB, and it
just wrap the Geronimo's Transaction Manager;
        
        Finally , I guess if the tranql provided XADatasource is not
compatible with my application. So I try the following calling sequence, but
they both occurs same problem;
        1:open-connection-->begin-trans-->do-update--> end-trans->close-conn
        2:begin-trans-->open-connection-->do-update-->end-trans->close-conn;
        3:begin-trans->open-connection-->do-update-->close-conn->end-trans;
        
        Now I have no idea about this problem, so I hope if anyone can
help-me to check this problem
        Thanks for any-suggestion;
===========================================================================
Orcla XA Warning is:
009-12-25 19:39:00,500 WARN  [Transaction] Unable to enlist XAResource
org.apache.geronimo.transaction.manager.wrappernamedxaresou...@1e7dc51,
errorCode: -3
oracle.jdbc.xa.OracleXAException
        at
oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157)
        at
oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:295)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(Wrapper
NamedXAResource.java:86)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(Trans
actionImpl.java:209)
        at
org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getCo
nnection(TransactionEnlistingInterceptor.java:54)
        at
org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConn
ection(TransactionCachingInterceptor.java:87)
        at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnec
tion(ConnectionHandleInterceptor.java:43)
        .......
        at java.lang.Thread.run(Unknown Source)

Geronimo Exception is:
javax.transaction.RollbackException: Unable to commit: transaction marked
for rollback
        at
org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResourcesDur
ingCommit(TransactionImpl.java:671)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionIm
pl.java:270)
        at
org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(Transa
ctionManagerImpl.java:250)
        at
org.apache.openejb.core.CoreUserTransaction.commit(CoreUserTransaction.java:
62)
        at
org.apache.openejb.core.BaseContext$UserTransactionWrapper.commit(BaseContex
t.java:194)
        at
sampleear.MyStatelessSessionBean.sayHello(MyStatelessSessionBean.java:40)
        ......
        at java.lang.Thread.run(Unknown Source)
        
                


I configed oracle-xa-datasource's plan is:

<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2";>
    <dep:environment 
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2";>
        <dep:moduleId>
            <dep:groupId>console.dbpool</dep:groupId>
            <dep:artifactId>oraclexatest1</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>rar</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>oracle</dep:groupId>
                <dep:artifactId>oracle</dep:artifactId>
                <dep:version>1.0</dep:version>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>oraclexatest1</name>
                    <config-property-setting 
name="NetworkProtocol">tcp</config-property-setting>
                    <config-property-setting 
name="PortNumber">1521</config-property-setting>
                    <config-property-setting name="TNSEntryName"/>
                    <config-property-setting name="MaxStatements"/>
                    <config-property-setting 
name="DataSourceName">OracleXADataSource</config-property-setting>
                    <config-property-setting 
name="DriverType">thin</config-property-setting>
                    <config-property-setting 
name="Password">changjun</config-property-setting>
                    <config-property-setting 
name="ServerName">168.1.100.30</config-property-setting>
                    <config-property-setting name="Description"/>
                    <config-property-setting name="LoginTimeout"/>
                    <config-property-setting name="DatabaseName"/>
                    <config-property-setting 
name="ServiceName">ora9i30</config-property-setting>
                    <config-property-setting 
name="UserName">changjun</config-property-setting>
                    <connectionmanager>
                        <xa-transaction>
                            <transaction-caching/>
                        </xa-transaction>
                        <single-pool>
                            <max-size>10</max-size>
                            <min-size>0</min-size>
                            <match-one/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>

Attachment: MyStatelessSessionBean.java
Description: Binary data

Attachment: MyServlet.java
Description: Binary data

Attachment: TestGeronimoTransactionManagerWithOracle.java
Description: Binary data

Reply via email to