Subject | Re: [Firebird-Java] jms and connections problem |
---|---|
Author | David Jencks |
Post date | 2005-02-09T15:41:38Z |
This is slightly odd since jbossmq manages its own transaction control
and puts stuff in the database using autocommit. Are you using
firebird for anything other than the message queues?
One thing that puzzles me about your -ds configuration is that you are
using PooledConnectionDatasource as an XADatasource. I haven't kept up
with exactly what Roman has implemented, but I would expect a pooled
datasource not to implement xa. In any case, for jbossmq only, you
don't need xa. Therefore I'd suggest either using the jca adapter -ds
configuration which does support xa (although there are unimplemented
parts of recovery as I understand) or using a non-xa -ds configuration
using a datasource.
As a side comment, firebird doesn't implement dirty read, so "read
uncommitted" is not going to give you what you ask for. I think you
get "read committed".
thanks
david jencks
and puts stuff in the database using autocommit. Are you using
firebird for anything other than the message queues?
One thing that puzzles me about your -ds configuration is that you are
using PooledConnectionDatasource as an XADatasource. I haven't kept up
with exactly what Roman has implemented, but I would expect a pooled
datasource not to implement xa. In any case, for jbossmq only, you
don't need xa. Therefore I'd suggest either using the jca adapter -ds
configuration which does support xa (although there are unimplemented
parts of recovery as I understand) or using a non-xa -ds configuration
using a datasource.
As a side comment, firebird doesn't implement dirty read, so "read
uncommitted" is not going to give you what you ask for. I think you
get "read committed".
thanks
david jencks
On Feb 9, 2005, at 6:11 AM, jivkoto wrote:
>
> Hi to all of you,
> (it;s me again) I am working with Firebird 1.5.2, Jaybird 1.5.5 Jboss
> 3.2.6. I am wondering if there are any problems with jms storing in
> firebird. I will be thankful if someone take a look and give a hand on
> this:
> I am sending many jms messages on two queues, let say A and B. after a
> while my jboss freezes.
> Result: many of the messages has reached there destination. But from a
> moment all are stored in JMS_MESSAGES. There is record in JMS_MESSAGES
> for one of the queue (B) with CTXID column set, so there is a record
> in JMS_TRANSACTION as set in CTXID. In some cases (not in all) there
> is a record in RDB$Transactions with RDBM$Transaction_STATE = 1 (which
> should be COMMITED). But after i restart jboss there is exception
> telling me that "record from transaction XXX is stuck in limbo" (XXX
> is the transaction from the system table).
>
> Here is my firebird-xs-ds.xml file
> <?xml version="1.0" encoding="UTF-8"?>
> <datasources>
> <mbean code="org.firebirdsql.management.FBManager"
> name="jboss.jca:service=FirebirdManager">
> <attribute name="FileName">C:\Documents and
> Settings\zhivko\WORKFLOWDB</attribute>
> <attribute name="UserName">sysdba</attribute>
> <attribute name="Password">masterkey</attribute>
> <attribute name="CreateOnStart">true</attribute>
> <attribute name="DropOnStop">false</attribute>
> </mbean>
>
> <xa-datasource>
> <jndi-name>WORKFLOWDB</jndi-name>
> <track-connection-by-tx>true</track-connection-by-tx>
> <isSameRM-override-value>false</isSameRM-override-value>
>
> <xa-datasource-class>org.firebirdsql.pool.FBConnectionPoolDataSource</
> xa-datasource-class>
> <xa-datasource-property
> name="Database">localhost/3050:WORKFLOWDB</xa-datasource-property>
> <xa-datasource-property
> name="UserName">SYSDBA</xa-datasource-property>
> <xa-datasource-property
> name="Password">masterkey</xa-datasource-property>
> <!--user-name>SYSDBA</user-name>
> <password>masterkey</password-->
> <!--transaction isolation-->
> <config-property
> name="TransactionIsolationName">TRANSACTION_READ_COMMITTED</config-
> property>
>
> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-
> isolation>
> <!--pooling parameters-->
> <min-pool-size>10</min-pool-size>
> <max-pool-size>500</max-pool-size>
>
> <blocking-timeout-millis>300000</blocking-timeout-millis>
> <idle-timeout-minutes>15</idle-timeout-minutes>
>
> <!-- Debugging -->
> <track-statements>true</track-statements>
> <!-- HA -->
> <check-valid-connection-sql>SELECT * FROM tClient
> </check-valid-connection-sql>
> <new-connection-sql>SELECT * FROM tClient </new-connection-sql>
> <!--
> <valid-connection-checker-class-
> name>org.jboss.resource.adapter.jdbc.*</valid-connection-checker-
> class-name>
> -->
> </xa-datasource>
> </datasources>
>
> I tried with isolation level = TRANSACTION_READ_UNCOMMITTED but it was
> the same
>
> Another problem is the connection pooling. As you see i have
> configured min-pool-size=10 and idle-timeout-minutes = 15. After i
> start my application server (jboss) there are some exceptions that
> the connection is not in correct state. But as you see i did set
> new-connection-sql and check-valid-connection-sql attributes that are
> responsible to create and check if connection are still valid (not
> timeouted)
>
> 16:01:16,140 WARN [JBossManagedConnectionPool] Unable to fill pool
> org.jboss.resource.JBossResourceException: Could not create
> connection; - nested
> throwable: (java.lang.IllegalStateException: Cannot execute desired
> operation b
> ecause pooled connection has invalid state.)
> at
> org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createM
> anagedConnection(Unknown Source)
> at
> org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
> eateConnectionEventListener(Unknown Source)
> at
> org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fi
> llToMin(Unknown Source)
> at org.jboss.resource.connectionmanager.PoolFiller.run(Unknown
> Source)
> at java.lang.Thread.run(Thread.java:534)
> Caused by: java.lang.IllegalStateException: Cannot execute desired
> operation bec
> ause pooled connection has invalid state.
> at
> org.firebirdsql.pool.PingablePooledConnection.checkValidity(PingableP
> ooledConnection.java:169)
> at
> org.firebirdsql.pool.PingablePooledConnection.internalClose(PingableP
> ooledConnection.java:253)
> at
> org.firebirdsql.pool.PingablePooledConnection.deallocate(PingablePool
> edConnection.java:270)
> at
> org.firebirdsql.pool.PooledConnectionQueue.destroyConnection(PooledCo
> nnectionQueue.java:218)
> at
> org.firebirdsql.pool.AbstractConnectionPool.getPooledConnection(Abstr
> actConnectionPool.java:232)
> at
> org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection(F
> BConnectionPoolDataSource.java:352)
> at
> org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection(F
> BConnectionPoolDataSource.java:371)
> at
> org.firebirdsql.pool.FBConnectionPoolDataSource.getXAConnection(FBCon
> nectionPoolDataSource.java:402)
> ... 5 more
>
> If anyone has any idea please help.
>
>
>