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!

executing SQL inside UOW commit transaction

416711Jul 26 2004 — edited Jul 27 2004
We're doing some magic with Oracle transaction-specific temporary tables and transactions and need to execute some SQL inside the same transaction as the UOW commit, just before the changeset is written out to the database. In other words, before the UOW starts doing inserts, updates or deletes, we need to execute one stored procedure. Because of the magic, that stored procedure needs to run inside the same transaction.

We tried wrapping UnitOfWork and intercepting commit, but this doesn't work because a new transaction seems to be started inside UOW.commit.

Additionally, executing a ValueReadQuery seems to call commit() on the database Connection. The commit causes us to lose the data from our transaction-specific temporary table. We can work around this by calling getParent().getAccessor().getConnection() and making a JDBC call, but this call is deprecated. We'd rather have some way of controlling this commit behaviour so we don't have to do that sort of ugliness, but I haven't found a nice way of controlling that.

Our next strategy will be to hook into the postBeginTransaction event and then execute the SQL there, so my questions are:

1. Is there a way to get a ValueReadQuery to execute inside that event and use the same transaction?

2. Is there a way to prevent execution of a ValueReadQuery/StoredProcedureCall from committing?

3. Is there a nicer way to run a stored procedure inside the UOW commit's transaction before any inserts, updates or deletes happen?

I realize this is somewhat difficult to explain in a forum, so if there's anything I can clarify, I'd be glad to try.

Thanks,

---Nick
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2004
Added on Jul 26 2004
2 comments
428 views