persistence@glassfish.java.net

Problem with Committing a transaction

From: Adam Bien <abien_at_adam-bien.com>
Date: Wed, 17 Oct 2007 21:11:25 +0200

Hi All,

in a really complex (deep inheritance-hiearchies of persistent entites,
bidirectional references etc.) JPA Entity Model we have some problems
with committing the transaction into the database.

Use Case: Adding an additional relation to a bidirectional @OneToMany
relation causes the inconsistency in a specific context. However it is a
specific case - other Use Cases work without any problems. Remove and
all other operations work as well.

It turns out, that in this particular case the
java.sql.Connection.commit() isn't invoked. The problem is somehow
related with the
oracle.toplink.essentials.internal.helper.ConcurrencyManager and it's
depth field. At the end of the transaction the depth is greater than
one, so the final connection.commit isn't executed (TopLink thinks,
there are still some ongoing transactions). The problem here: all
following operations are not committed as well, because of this phenomenon.

We use TopLink inside Eclipse RCP with RESOURCE_LOCAL configuration.

Any thoughts, or ideas, what causes this phenomenon? We are using the
current TopLink Essentials version,

thank you in advance,

adam bien

-- 
 Consultant, Author, Java Champion
 
 Homepage: www.adam-bien.com
 Weblog: blog.adam-bien.com
 eMail:  abien_at_adam-bien.com
 Mobile: 0049(0)170 280 3144
 Books: Enterprise Architekturen (ISBN: 393504299X),
        Java EE 5 Architekturen  (ISBN: 3939084247),
        J2EE Patterns, J2EE Hotspots, Enterprise Frameworks and Struts