persistence@glassfish.java.net

Re: Problems Committing the DB Transaction narrowed, but not solved

From: James Sutherland <jamesssss_at_yahoo.com>
Date: Tue, 23 Oct 2007 05:46:02 -0700 (PDT)

Could you please,
turn logging on to FINEST and see when a "begin transaction" call occurs on
the TopLink session, and please include the log.

Also check if any exceptions are occurring? Are there any exceptions
occurring?

What are you doing exactly to recreate the issue, try to narrow down the
cause.

Are you executing any native SQL, or queries using pessimistic locking? Are
either of these being used?

They may be triggering a begin of a transaction that the EntityManager is
not aware of.


Adam Bien wrote:
>
> Hello,
>
> we were able to narrow the problem to the class AbstractSession from the
> package "oracle.toplink.essentials.internal.sessions".
> Trying to add a new bidirectional M:N relation with an intermediary
> entity (so actually it is N:1 <--> 1:m), Toplink sents everything, but
> not the final commit to the DB-transaction (we monitored the behavior
> with P6spy, as well as with DB tools).
>
> For some reasons the two blocks of the if statements are no more
> executed (also not in a new EntityTransaction)
>
> public void commitTransaction() throws DatabaseException,
> ConcurrencyException {
> // Release mutex and call subclass specific commit.
>
> ####IF BLOCK ISNT EXECUTED####
> if (!getTransactionMutex().isNested()) {
> getEventManager().preCommitTransaction();
> basicCommitTransaction();
> getEventManager().postCommitTransaction();
> }
>
> // This MUST not be in a try catch or finally as if the commit
> failed the transaction is still open.
> getTransactionMutex().release();
>
> // If there is no db transaction in progress
> // if there is an active external transaction
> // which was started internally - it should be committed
> internally, too.
>
> ###//ALSO NOT THIS ONE...####
> if (!isInTransaction()) {
> commitExternalTransaction();
> }
> }
>
> Any thoughts, whether it is possible to make recover TopLink from this
> inconsistent state? What could cause such a strange behavior?
> It isn't a DB/locking problem - we are still able to commit the
> connection...
>
> thank you in advance,
>
> adam
>


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.oracle.com/technology/products/ias/toplink/ Oracle TopLink , 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  https://glassfish.dev.java.net/javaee5/persistence/ TopLink
Essentials 
Wiki:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence , 
http://wiki.eclipse.org/EclipseLink EclipseLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink , 
http://www.nabble.com/java.net---glassfish-persistence-f13455.html Glassfish
Persistence 
-- 
View this message in context: http://www.nabble.com/Problems-Committing-the-DB-Transaction-narrowed%2C-but-not-solved-tf4673276.html#a13363450
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.