db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <Fisc...@seitenbau.net>
Subject Re: SET TRANSACTION must be first statement of transaction
Date Mon, 24 Jan 2005 15:44:46 GMT





Hi,

raphael.x.mankin@gsk.com schrieb am 24.01.2005 10:40:01:

> We are on Oracle 9.2.0/Linux. I am using oracle.jdbc.dirver.OracleDriver
> from ojdbc14.jar as the driver library wiith the 'thin' connection, and
> have been running without problems, at least none that were not of my own
> making, for close on a year. classes12.jar does not work at all for me.
The
> pool is SharedPoolDataSource.
>

Thats exactly what I am using myself, and I did not run in any errors so
far. However, this does not mean this will not happen in the future, so I
am very interested in getting this fixed.

Have you already tried to use P6Spy to log your database statements ? I
have never done it myself, no idea how well it is working and whether it
also logs the changes in transaction isolation, but if it does, it would
help very much to pinpoint the error.

I did not find any references to Connection.setTransactionIsolation() in
Torque code. This means that with a probability of 99.9%, the error does
not lie within Torque. Perhaps someone at db-commons can help you (it is
their pool, after all).

If you need a really quick solution, you can
a) use another pool (perhaps you use an application server which is
providing one)
b) use read committed instead of serializable as transaction isolation, if
this is acceptable for you.

More comments below.

Please tell us your advances in solving this problem,

         Thomas

>
>
> I quite agree that this is almost certainly an Oracle rather than a
Torque
> problem. However the references I dug out suggest that there are
> work-arounds one can put into the Torque code that would avoid at least
> some instances of this problem. It is worth looking at the Torque code to
> see whether those work-arounds are actually in place.
>
> ...
>
> raphael.x.mankin@gsk.com schrieb am 21.01.2005 15:20:09:
>
> > Searching the web, I have found the following *possible* causes. Which
> one
> > may be the actual cause of my problem I don't yet know.
> >
> > The problem is actually manifested deep in the Torque library classes,
> > which I cannot see. Maybe some of the maintainers can check wether any
of
> > these possible causes are actually present in the Torque base code.
> >
> >
> > ORA-01453 SET TRANSACTION must be first in transaction
> >
> >
> > 1.    After diagnosing the code I found in one place after getting the
> > connection we change the transaction type and before closing the
> connection
> > we are setting it back to original transaction type. After commenting
> that
> > code I never got that error.

Well, this one is certainly in the pool code, not in the Torque code. I
have searched for references to Connection.setTransactionIsolation in
Torque source code and found none.

> > 2.    I was able to fix the database problem by changing the datasource
> > configuration from "serializable" to "read committed".

This can solve a lot of problems, but is sometimes not what one wants. The
reason why this might solve problems is that oracle returns the connection
with transaction isolation READ_COMMITTED as default, so there is no need
to change the transaction isolation.

> > 3.    In the connection pool setting in Admin server under the section
> > Transaction Isolation deselect the option "Guarantee Isolation Level"
> .This
> > should solve the problem.

This is only a solution for a certain connection pool whis is provided by
an application server. It will not work with SharedPoolDatasource

> > 4.    Oracle works fine (except for a certain quirk when checking
> existing
> > = tables) as long as no tx isolation is set. [snip] Oracle seems to do
> best
> > with only one or two of = the possible isolation levels anyway.
> > From: Gavin King
> > Subject: Re: [Hibernate] HELP: Hibernate and Oracle
> > Date: Fri, 22 Nov 2002 15:41:22 +0100 (CET)
> >
> >
>
--------------------------------------------------------------------------------

>
>
> >
> >
> > I've never seen this problem before, but it looks like Oracle doesn't
> like
> > the idea of calling
> >
> > Connection.setTransactionIsolation()
> >
> > after callong
> >
> > Connection.setAutocommit(false)
> >
> > This is not a problem for other platforms, but I will swap the order
> > anyway.. The entire message can be viewed here:
> > http://www.mail-archive.com/hibernate-devel@lists.sourceforge.
> > net/msg00827.html
> >

This might be a reason, though I do this in my code myself. Again, this is
done in the pool and not in Torque

> >
> > 5. I saw -->
> > http://edocs.bea.com/wls/docs70/jta/thirdpartytx.html
> > WHICH STATES
> >
>
----------------------------------------------------------------------------

>
>
> > -----------------------
> > Description
> > Oracle Bug
> > Comments/Workarounds for WebLogic Server
> >
> > ORA-01453 - SET TRANSACTION must be first statement of transaction
> >
> >
> > When using the Oracle Thin/XA 8.1.7 driver, you cannot change the
> > transaction isolation level for a transaction. Transactions use the
> default
> > transaction isolation as set for the database.
> >
> >

You use 9.2, not 8.1.7, so this does not apply.



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message