users@glassfish.java.net

TopLink thread deadlock re UserTransaction.commit() in message-driven bean

From: <glassfish_at_javadesktop.org>
Date: Mon, 15 Oct 2007 15:07:12 PDT

We're getting thread deadlocks in TopLink during a UserTransaction.commit() call in a
message-driven bean using bean-managed transactions. The result is that two or more
message-driven bean threads never complete, thereby consuming a thread for each bean,
and the messages being processed by the onMessage() method calls are remaining
unacknowledged in the JMS queue. However, the database is properly updated as a result
of the UserTransaction.commit() call which actually never returns (???). It is also important
to note that this primarily occurs when we are sending many hundreds of messages in
a short time from an application client, and the payload of each message needs to be
persisted to the database.

I've attached a jstack dump of the app server and the source for the message-driven bean in
question. The thread dump has two calls to ScheduledRequestWrite.onMessage() that show
where the threads are blocked or waiting.

We're using:
Red Hat Enterprise Linux 5 (2.6.18-8.1.8.el5xen)
Sun Java System Application Server 9.1 (Glassfish v2)
Sun Java System Message Queue 4.1 (used in REMOTE mode)
TopLink Essentials v2 b58g
MySQL 5.0.45
MySQL Connector/J 5.0.7
Java 1.6.0_02

Any help would be greatly appreciated.

Thanks.
[Message sent by forum member 'skalynuk' (skalynuk)]

http://forums.java.net/jive/thread.jspa?messageID=240230