Subject JBoss/Firebird Integration
Author petr.kalina
hi,

I'm experiencing problems when using JBoss CMP on top of Firebird. I'm
not sure, wheather this is JBoss topic or if it's an issue of the
driver/db. I'm trying to get information from the jboss forums on this
topic as well, but any hints would be highly appreciated..

The exception looks like this:

org.firebirdsql.jdbc.FBSQLException: Problem getting connection:
org.jboss.resource.JBossResourceException: Could not enlist in
transaction on entering meta-aware object!; - nested throwable:
(javax.transaction.SystemException: java.lang.Throwable: Unabled to
enlist resource, see the previous warnings.
tx=TransactionImpl:XidImpl[FormatId=257,
GlobalId=jarchive.nem.homolka.cz/6929968, BranchQual=, localId=6929968])
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:88)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:210)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:128)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:598)
at
org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:322)
at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:245)
...

The exception occurs when the server is under heavy load and gets
excessive after some time... It runs JBoss 4.0.3SP1 and FB superserver
2 RC 1.

This is my Datasource config snippet:

<tx-connection-factory>

<jndi-name>FirebirdDS</jndi-name>

<xa-transaction/>

<rar-name>jaybird-2.0.1.rar</rar-name>
<connection-definition>javax.sql.DataSource</connection-definition>

<config-property name="Database"
type="java.lang.String">localhost:${jboss.server.data.dir}/firebird/data.fdb</config-property>

<min-pool-size>20</min-pool-size>
<max-pool-size>100</max-pool-size>

<idle-timeout-minutes>10</idle-timeout-minutes>

<blocking-timeout-millis>5000</blocking-timeout-millis>

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml
(optional) -->
<metadata>
<type-mapping>Firebird</type-mapping>
</metadata>
</tx-connection-factory>

I got very similar exceptions using classical server - that is why I
went for SS. However it's still aching.

I have several questions in addition to this:
1) how to enable more detailed loging in firebird?
2) how to see how many connections are currently opened to a server
3) how to make a periodic flush of all opened connections

Thanks for amy assistance or ideas,
-- petr kalina