Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cache merge in JTA transaction

489129Jun 26 2006 — edited Jul 5 2006
I'm looking at code that attempts to do the following:

1. Using JTA, atomically:
a. Write changes to an object to a database using Toplink.
b. Post a message to a JMS topic.

(The topic and the connection pool are both configured to use XA, and Toplink is correctly configured to use an external JTA controller in the WebLogic platform.)

2. After the commit occurs, the message on the topic is consumed. The consumer immediately reads the newly saved object, which is served out of the Toplink session cache.

The problem is that I am seeing a race condition in the message consumer method, such that depending on if or how much I delay, I may or may not see the object modifications from step 1a. If I modify my read-object query to bypass the cache and force a database refresh, I always see the correct result.

I'm trying to determine if Toplink merges changes back into the cache before or after it sends the final ack in the 2PC protocol. I read the excellent timeline in 1033391 and it sounds like it might be "after" (?). If so, it would seem that there is indeed a window of time in which a race can occur in my scenario. Or if not, maybe there is a flaw in this code somewhere that I just can't seem to find.

Thanks.

_Scott
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2006
Added on Jun 26 2006
3 comments
457 views