org.jboss.mq.SpyJMSException: Could not store message: 2 msg=1 hard NOT_STORED PERSISTENT queue=QUEUE.teema_email_queue priority=4 lateClone=false hashCode=28390332; - nested throwable: (java.sql.SQLException: Io exception: Connection reset)
Above exception is thrown when trying to enqueue object into a JBoss JMS queue that is backed by a Oracle database.
The cryptic error message is not much help. Neither does Google. Not able to find stock anwser, I started to lay down facts in order to piece together the puzzle. The first clue is that the error appears only in a particular use case, but not in others. What is the difference, I wonder. One noticeable difference is that the object to be enqueued in the failed use case is quite large compare to those in other use cases. May be size of the object is the deciding factor here. A quick testcase confirmed my suspicion.
As I know JBoss saves JMS message as blob, this looks like a problem in handling blob data. Googling "oracle blob size" turns out both explanation and solution. Apparently the older Oracle thin JDBC drivers Upgrade to Oracle driver for 10g, which is compatible with Oracle 9 database, fixes the problem.