Subject JRun4 and Firebird transactions not working
Author Jeff Bannister
Hi,

I currently have an application running with JRun4(Build 61650) and
Firebird(v1.0.3) and Jaybird JDBC driver (v1.0.0-RELEASE).

I have one datasource configured in jrun-resources.xml as follows...

<data-source>
<dbname>BULKMAIL</dbname>
<jndi-name>jdbc/BULKMAIL</jndi-name>
<driver>org.firebirdsql.jdbc.FBDriver</driver>
<url>jdbc:firebirdsql:localhost/3050:C:\Program
Files\Firebird\examples\employee.fdb</url>
<username>sysdba</username>
<password>masterkey</password>
<isolation-level>READ_COMMITTED</isolation-level>
<native-results>true</native-results>
<initial-connections>1</initial-connections>
<minimum-size>1</minimum-size>
<maximum-size>70</maximum-size>
<connection-timeout>60</connection-timeout>
<user-timeout>120</user-timeout>
<skimmer-frequency>1800</skimmer-frequency>
<shrink-by>10</shrink-by>
<debugging>true</debugging>
<transaction-timeout>10</transaction-timeout>
<cache-enabled>false</cache-enabled>
<cache-size>10</cache-size>
<cache-refresh-interval>20</cache-refresh-interval>
<remove-on-exceptions>true</remove-on-exceptions>
</data-source>

My application has an MDB (P2P) that consumes messages from a queue
'MailDelivery'. This MDB has the transaction attribute 'Required'. This MDB
generates an email via JavaMail and then writes and entry to a database
table using JDBC and the datasource configured above.

Whilst this is happing I have a client application making calls to a SLSB
which via the datasource is performing a query to count the number of logs
enties written in step 1. I have no transaction attributes set for this
SLSB, so I am assuming is should be 'Required'.

Unfortunatley I keep getting SQL exceptions thrown. I get several different
exceptions but the key one is as follows....

com.beetleweed.bulkmail.ejbs.DAOException: SQL error : ****** GDS Exception.
no local transaction active: can't commit ******

at
com.beetleweed.bulkmail.ejbs.DataAccessObject.logAndThrow(DataAccessObject.j
ava:82)

at
com.beetleweed.bulkmail.ejbs.DataAccessObject.sqlError(DataAccessObject.java
:72)

at com.beetleweed.bulkmail.ejbs.MailDAO.store(MailDAO.java:45)

at
com.beetleweed.bulkmail.ejbs.MailProcessorBean.onMessage(MailProcessorBean.j
ava:174)

at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at
jrun.ejb.interceptors.InvokerInterceptor.invokeObjectMethod(InvokerIntercept
or.java:153)

at
jrun.ejb.interceptors.TransactionInterceptor.invokeTransactedMethod(Transact
ionInterceptor.java:203)

at
jrun.ejb.interceptors.TransactionInterceptor.invokeObjectMethod(TransactionI
nterceptor.java:130)

at
jrun.ejb.interceptors.MessageDrivenInstanceInterceptor.invokeObjectMethod(Me
ssageDrivenInstanceInterceptor.java:42)

at
jrun.ejb.interceptors.EJBSecurityInterceptor.invokeObjectMethod(EJBSecurityI
nterceptor.java:81)

at jrun.ejb.EJBContainer.invokeObjectMethod(EJBContainer.java:193)

at
jrun.ejb.invocation.MessageDrivenInvocationProxy.invokeContainer(MessageDriv
enInvocationProxy.java:44)

at
jrun.ejb.invocation.jms.MDBInvocationProxyJMSImpl.invoke(MDBInvocationProxyJ
MSImpl.java:236)

at
jrun.ejb.invocation.jms.MDBMessageListener.onMessage(MDBMessageListener.java
:49)

at jrun.jms.core.client.JmsSession.processMessages(JmsSession.java:623)

at jrun.jms.core.client.JmsSession.run(JmsSession.java:646)

at jrun.jms.xa.JRunXASessionImpl.run(JRunXASessionImpl.java:181)

at jrun.jms.asf.ServerSessionImpl.runXASession(ServerSessionImpl.java:111)

at jrun.jms.asf.ServerSessionImpl.run(ServerSessionImpl.java:70)

at java.lang.Thread.run(Thread.java:536)

Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. no local
transaction active: can't commit

at
org.firebirdsql.jdbc.FBConnection.checkEndTransaction(FBConnection.java:1033
)

at
org.firebirdsql.jdbc.FBPreparedStatement.execute(FBPreparedStatement.java:39
3)

at jrun.sql.JRunPreparedStatement.execute(JRunPreparedStatement.java:105)

at com.beetleweed.bulkmail.ejbs.MailDAO.store(MailDAO.java:42)

... 19 more


STACK TRACE END#####################]



I can see no reason why I would be getting this error. On further tests I
notice that running concurrent transactions accessing my database causes lot
of issues. I get 'Cursor Unknown' exception, 'DeadLock' exception...

Clearly something is fundamentally wrong. I do not believe this issue an
application code level one. I guess it's either a mis-configuration, a bug
in JRun, or a Firebird.

I am left perplexed. Does anyone has any ideas? because to me it looks as if
Firebird/JRun simply don't work together and I may have to either switch
DB's or app servers.



regards,

Jeff.