I have a session bean and an entity bean and the isolation level in both are set to TRANSACTION_SERIALIZABLE because in simulataneous transactions should not be allowed as it might create duplication of data. when 2 persons do the same operation for the first time, i get serializable error for one client and the operation is successful for the other. this works fine. but when i repeat the same for the second time, the client hangs. what could be the problem in this case ?? can u help me in this
What database are you using. It's important. It sounds a bit like Oracle to me. Oracle will let both transactions continue and then kick the second one out when it tries to commit. Sybase and SQL Server will run them one at a time (In essence the table is locked. I won't bore you with the details of how it decides what locks to take.)
As to why the client hangs. I need to know what "the second time" means. When the failed transaction tries again? When you restart your client JVM? What is the state of the system between the first and second attempts?
I think you should ensure that transactions you are performing first time with a client should be finished before starting second time.