Skip to Main Content

Java Development Tools

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!

Rolling back lock after RowInconsistentException (in ADF 11g)

454311May 15 2009 — edited May 15 2009
The JDeveloper 11g documentation explains under "Advanced Entity Object Techniques" how to override the select and lock functions so that you can do the locking with a stored procedure. I think I've done this as documented, but when I detect that another user has changed the row and raise the RowInconsistentException, this leaves the row locked (because the stored procedure did a "select for update"). So the user correctly gets told that someone else has changed the row, but the row stays locked until he does something else. I want to treat the RowInconsistentException as a failure and leave the row unlocked as it was before.

I suppose I could invoke "getDBtransaction.rollback()" from my EntityImpl.java's doSelect() before throwing the RowInconsistentException, or perhaps from lock() after detecting it, but the example in the documentation doesn't do this so I'm worried that it might confuse ADF. So is there something else that I should be calling instead, in order to do the rollback?

I'm sorry if I've missed the answer somewhere in the documentation, but I can't find it, so I'd very much appreciate it if someone can tell me how it's supposed to work.

Thanks
Phil

Minor update: I've now tried using rollback(), but that does indeed seem to mess something up, because the user then doesn't get given an error message. He gets to see the current state of the database, because I use refresh(REFRESH_WITHDB_FORGET_CHANGES), but doesn't get an error message even though I'm still throwing RowInconsistentException - somehow the rollback seems to be causing this exception to get ignored! I need to tell the user that his change is not being implemented because someone else had already changed the row, while leaving the row unlocked. Help!

Edited by: user451308 on May 15, 2009 11:56 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2009
Added on May 15 2009
0 comments
330 views