Subject Re: [Firebird-Java] Invalid connection after JBoss IdleRemover-Action (NPE)
Author Uno Engborg
Josef Gschwendtner wrote:

>one of our customers is getting sporadically NullPointerExceptions
>(which last for a certain period).
>To avoid the great number of NPE's we have changed methode
>isc_start_transaction in Jaybird to log a message on db.out == null and
>throw an exception afterwards. This has improved the situation because
>instead of many NPE's we get one exception and afterwards the program
>works as expected, again.
>One of our customers had this fault-situation (db.out == null) 5 times
>last week. We found out, that the situation always occures immediately
>after the JBoss IdleRemover-thread was active and probably has freed a
>connection which was used by another thread (also the situation occures
>not each time the IdleRemover-thread was active).
>We think there might be a synchronisation problem.
>Another customer runs the same program without any problems.
>Both custumers use RedHat 7.2.
>- Customer with problems uses kernel 2.4.20-28 (the newer one)
>- Customer without problems uses kernel 2.4.7-108
>Other Conditions:
>- Software: Java 1.4.2_03, JBoss 3.2.3, Jaybird 1.5.5
>- Hardware: Dual Xeon CPU (3,06 GHz), 2 GB RAM

At the end of your firebird.ds there is a setting where you make some
simple query to test the connection.
Have you tried that? The connetionion factory would look something like
this with an added
query "select * from testconnection" that should be very fast to perfom





<config-property name="Database"



<!--additional properties. only use one way of setting tx isolation,
<config-property name="TransactionIsolation"></config-property>
<config-property name="BlobBufferLength"></config-property>
<config-property name="Encoding">UNICODE_FSS</config-property>

<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>

<!-- sql to call on an existing pooled connection when it is
obtained from pool
<check-valid-connection-sql>some arbitrary
<check-valid-connection-sql>select * from

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml
(optional) -->

Uno Engborg

[Non-text portions of this message have been removed]