-
1. Re: commit options, object locking and deadlock
_scottwilliams_ Nov 19, 2002 10:15 PM (in response to timfox)Is there any documentation of the different types of locking available in jboss 3.x with information about the pros/cons of each type of locking?
Also, can I change the locking behavior just by add in a locking tag in the jboss.xml file of my ejb jar?
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy> -
2. Re: commit options, object locking and deadlock
timfox Nov 20, 2002 6:53 AM (in response to timfox)hi scott-
this is an old message of mine.
to let you know we solved our problem in the end by using one of the "instance per transaction" container configurations, with commit option C - (and we actually use the excellent MVCSoft for CMP persistence - for performance reasons).
this config. scales well as opposed to the default config. which (IMO) doesn't scale AT ALL for most normal (ie multi user applications).
luckily jboss is highly configurable and comes with several pre-defined container configurations for different situations - some are more applicable for enterprise systems, others for clustered systems and others for single user or read-mostly applications.
you need to be careful which one you choose since the default config. only keeps one instance of each entity and pessimistically locks on it whether on or not it is changed in the transaction - hence is prone to deadlock.
you can of course roll your own, and choose your own combination of locks and interceptors but if you careful you may end up with a config that either defies the ejb spec, loses ACIDity or has other problems.
all of this is documented in the paid jboss docs.
HTH