Hi
Under heavy load Mysql/INNODB can at any moment throw
SQL deadlock exception, even on a simple attempt to
insert a single row, and they say that there's "nothing
dangerous" and code must be ready to restart
transaction at any moment:
http://dev.mysql.com/doc/mysql/en/Innodb_deadlocks.html
See example 4.1 (section 4.4) here:
http://dev.mysql.com/doc/connector/j/en/index.html
As far as I understand, container should take care of
such situations and behave much like in case of
retriable ADE. There's nothing CMT entity bean can do
here itself except for constructing and throwing
vendor-specific ADE.
Thanks
Logged In: YES
user_id=118051
I meant CMP entity bean. BMP can't do anything either.
Logged In: YES
user_id=9459
There is already support for arbitrary retry handlers in
jboss-3.2.4RC1
See the testsuite for examples if you cannot wait for this to be
documented.
Maybe you can contribute a MySQL deadlock handler?
Logged In: YES
user_id=9459
Konstantin Sobolev wrote:
How can I contribute a MySQL deadlock handler?
I need sources, examples and some way to send resulting code.
General instructions for developers can be found here:
http://www.jboss.org/developers/projects/jboss/projects
You will find the testsuite examples here:
http://cvs.sourceforge.net/viewcvs.py/jboss/jbosstest/src/resources/retry/
http://cvs.sourceforge.net/viewcvs.py/jboss/jbosstest/src/main/org/jboss/test/retry/
When you have a patch, just attach it to this RFE and change
the "Data Type" to patches.
Regards,
Adrian
MySQL retry handler
Logged In: YES
user_id=118051
Here it is. Please place in the appropriate package.
Unfortunately SF doesn't allow me to change the "Data Type".
Thanks
Logged In: YES
user_id=9459
Loops are more efficient than recursion, they use less stack.
That is why most parsers use tables instead of recursive decent.
What is the purpose of the commented out code?
Logged In: YES
user_id=118051
I know about recursion and loops; I decided to use recursion
because it won't be too deep, only 2-3 steps, and at the
same time it is more compact and easy to read.
Commented code can be safely removed. It is just and old
variant we used before we found 'official' MySQL exampe.