OSSequence and transactions
"Brian Topping" <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I'm using sequences and have some concern that I don't understand the semantics as well as I should or there is something that ought to be fixed in the sequence code. The easiest case to see this in is when the sequence is used for the first time. The current sequence is fetched from the entity, incremented, and that new high value stored back out. If everything works fine at the client level, this works great, and the entity is properly committed. But if the enclosing transaction fails, the entity is rolled back as well. This seems to be incorrect because the memory sequence is still moving forward. When it is time to get the next high value, the last high value is actually retrieved, causing duplicate keys to be issued for the next high value increment of keys. Shouldn't the sequence session bean be set to require a new transaction such that it will commit regardless of whether the transaction that it was called under commits? -b ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf