Madhusudan Iyengar wrote:

> I have a stateful session bean which has to execute four prepared
> statements, there is a dependency of a table between the first and the
> last
> statement. I also need to be able to rollback all the changes if exception
> occurs in any of the statements. Because of the dependency pages in the
> database gets locked, if I put them in separate transactions how do I
> rollback the changes.
>
> Any suggestions would be appreciated.


A dependency of a "table" between two of the SQL statements does not necessarily
cause deadlock on the database. You should be able to put all the SQL statements
into a single transaction by getting the database locking options right. There
are two things to do:

1. Ensure locking is done at the row level rather than at the table level.

2. Ensure that the protection level is set to "update consistency"
   as opposed to "repeatable read" (this is because repeatable read
   has a tendency to lock the entire table anyway).


Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to