Hello!

            I am using JBoss 3.0.2 with bundled tomcat 4.0.4.  I am also using the Firebird database with

Firebird-jca-jdbc-driver RC1 (I also tried RC1a).

            I am having the following exception when I have two concurrent Transactions:

 

19:13:47,351 ERROR [GlobalTxEntityMap] Store failed on entity: [.xpto.]

javax.ejb.EJBException: Store failed; CausedByException is:

        GDS exception: org.firebirdsql.gds.GDSException: deadlock

update conflicts with concurrent update

 

            I have a session bean which handles sequence values through an Entity Bean. The session bean starts one transaction each time the sequence must be incremented (this is done in one method of the session bean):

 

            sessionMethod

                        start transaction

                                    query sequence value

                                    update sequence value with previous value + 1

                        end transaction

 

 

            If I have two concurrent transactions to increment the same sequence, Firebird crashes with the exception above. I have tested this with Oracle and it works fine. I have accomplished my test inserting a sleep of several seconds (30) between the query and the update.

            The second transaction blocks before the read, and only continues after the first one finishes. With Oracle, the second transaction reads the value stored by the previously transaction with firebird, it reads the same value as the previous transaction (Although it waits for the first to finish).

            For instance, if the value of one sequence is 10 and I start 2 concurrent transactions to get the new value, I get the following:

 

            Oracle:

            Tx1 – gets 10, stores 11 and the session method returns 11

            Tx2 – waits for the first Tx to finish, gets 11, stores 12 and the session method returns 12.

 

            Firebird:

            Tx1 – gets 10, stores 11 and the session method returns 11

            Tx2 – waits for the first Tx to finish, gets 10, tries to store 11, but crashes with the exception above.

 

            Can any one help me, please? Any help would be welcome.

 

            Thanks in advance,

                        Victor Batista

Reply via email to