To understand the Geronimo connection manager and the transaction
manager, you might want to dig into the components code here [1]. For
example, the
org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor
class does the resource enlist/delist work.
I'd suggest you to remotely debug your sample app (start geronimo in
debug mode) and walk through the code of Geronimo transaction manager
and connection manager, to fully understand the code flow.
[1] http://svn.apache.org/repos/asf/geronimo/components/txmanager/
-Jack
On Wed, Dec 30, 2009 at 5:14 PM, xuhongbo x...@tongtech.com wrote:
Hi Jack Cai:
I have tried, the tranql-connector-oracle-local is ok, but it doesn’t use
xa transaction in jta, and use a faked Local-XAResource instead of real
oracle-xa-resource;
I am sorry to mis-understand your means and give the run-time class name in
my previous reply; The error occurred program is just using
tranql-connector-oracle-xa
Additionally, I have try another Mysql database and using
tranql-connector-mysql-xa do real xa transaction. It works well.
So my mind changed, maybe there is something not compatible with oracle 9i
database; In my original mail, I have post a very simple program which use
the Geronimo Transaction Manager and Oracle XA API directly, this works
well;
Because tranql resource adaptor is a very simple wrapper , Geronimo does
additional things to wrap the database connection (etc control pooling,
xa-resource wrap, xa-resource cache for transaction-manager ...) , so I am
wondering if there is some other un-excepted database operation has been
done and cause this problem? for convenience I post the simple program
again.
If we only concern database operation, does this simple program done
exactly like the Geronimo done ? Or it doesn't , Geronimo do additional
things... maybe the difference will be the real reason cause the problem;
I have tracked at runtime, but unfortunately has not find some difference
yet...
Thanks a lot
xuhongbo
-origin-
sender: Jack Cai [mailto:greensi...@gmail.com]
date: 2009/12/30 11:45
receiver: user@geronimo.apache.org
subject: Re: Reply: Cannot using Geronimo to execute bean-managed
transaction with oracle transaction more than once, but Glassfish does
Can you try to use the tranql-connector-oracle-xa or
tranql-connector-oracle-local to do the test?
-Jack
On Wed, Dec 30, 2009 at 11:26 AM, xuhongbo x...@tongtech.com wrote:
In the future it would be great if you could only post to one mailing
list.
Thanks, I know
I'm not sure what is wrong yet, however you should never try to set
the autocommit state of a connection that is enlisted in a jta
transaction. Enlisting and delisting the XAConnection will result in
the autocommit being dealt with properly. The value from
getAutoCommit may or may not be meaningful in a jta transaction.
Outside a jta transaction the autocommit state defaults to true. I'm
quite surprised you didn't get a more informative error.
Yes you are right, auto commit has no means for jta connection and cannot
be
set to true; here I just set auto commit to false, so a jta connection
should just omit it;
But the surprise thing is if I doesn't affect auto commit state(in the
program, just comment the statement setAutocommit(false)), when execute
database operation, a ORA-02089: COMMIT ... exception will be throwed
by
oracle's database driver; it looks like the Geronimo does a wrong things
commit on the connection when execute database operation; and this
should
only occurs on non-jta connection, because only no-jta connection will set
auto commit default to true.
One important piece of information that I don't see is which tranql
wrapper you used to deploy your datasource.
The datasource is org.tranql.connector.jdbc.DataSource. And it use a a
managed-connection factory org.tranql.connector.oracle.XAMCF to open
connection; And the managed-connection factory use a oracle's xa
datasource
(oracle.jdbc.xa.client.OracleXADataSource);
By the way , I haven't ever post a trivial problem I have meet when I
deploy
the Oracle-XA data source. The trivial thing is: I must change the deploy
plan created by Geronimo's web manage console tools, delete the empty
property TNSEntryName and manually deploy it; because this is the
oracle9i
database driver's question --- a empty string value(not a null value) set
to TNSEntryName will cause oracle9i's database driver to omit the other
property (etc serverName, serviceName ...) and cannot establish a connect
;
I thinks this should have no means to the transaction commit failure; but
maybe it would give some other useful things help to find out the reason.
Thanks a lot
xuhongbo
-origin -
sender: David Jencks [mailto:david_jen...@yahoo.com]
date: 2009/12/30 1:43
receiver: user@geronimo.apache.org
subject: Re: Reply: Cannot using Geronimo to execute bean-managed
transaction with oracle transaction