-
1. Re: Experiencing Deadlock...
thedug Sep 5, 2001 2:36 PM (in response to thedug)I upgraded to 2.4 and the problem still exists.
-
2. Re: Experiencing Deadlock...
binaryfeed Sep 6, 2001 7:10 PM (in response to thedug)We are suffering with the same issues. JBoss *ALWAYS* uses pessimistic locking for Entity beans. That is, if you use an entity bean (i.e. -- invoke any method on it) within the context of a transaction, that entity will be locked until the transaction commits, rolls back or times out. With this locking scheme, it's VERY easy for deadlock to occur with complex or long-running transactions. If you don't have any long-running transactions, one solution might be for you to lower your transaction timeout to a very small number (less than 5 seconds). This way, at least the deadlocks won't grind the system to a halt.
-
3. Re: Experiencing Deadlock...
jemi Sep 18, 2001 8:26 PM (in response to thedug)We also encountered the problem of flooded log files in case of locking situations and this is certinaly a bug that I hope will be fixed with the next version .
Btw. another source of the locking besides the reentrance could be caused by your general architecture - some mistakes that we also made earlier. Locks and deadlocks can easily occur if you for instance have entity beans calling other entity beans, (which with a proper design should not be happening) or if you have two or more simultaneously running longer business processes encapsulated in a transaction contexts within session beans that happen to try to access the same enity beans. (In this case the first bean tries to complete the transaction and blocks resources, the second bean tries to do the same and locks resources up to the point where it needs to access entity beans locked by the first bean. If then the first bean encounters resouces bound by the second bean they are likely to keep on waiting for each other.) So checking your design with a dynamic perspective could be a good point to start solving your problem.
Jemi -
4. Re: Experiencing Deadlock...
jemi Sep 18, 2001 8:41 PM (in response to thedug)another tip. IN case you are using Container Managed Persitence it would also be worth checking whether you make use of the is modified flag. You can set the is modfied flag for an entity bean if you actually perform write operations that alter the contents of your database. (not for every read operation) You can configure JBoss then in a way that the persitency engine writes the beans only to the database in case the is modified flag is set.
This way you maybe not only minimize the probablility of colliding requests that result in locking situations but also you will be surprised about the general performance increase of your system.
Jemi