Subject NPE in isc_start_transaction (db.out.writeInt(op_transaction))
Author Josef Gschwendtner
Hi,

One off our customers get sporadically NullPointerExceptions (which last
for a certain period).

Conditions:
- Software: RedHat 7.2, Java 1.4.2_03, JBoss 3.2.3, Jaybird 1.5.4
- Hardware: Dual Xeon CPU (3,06 GHz), 2 GB RAM
- The server is under heavy load (> 10 transactions per second).

Logging the Jaybird debug messages we have seen that the exception
occurs
in method "isc_start_transaction" of class "GDS_Imp".
The NPE occurs upon call of methode db.out.writeInt(op_transaction).

Because we couldn't reproduce the exception we accessed the
isc_db_handle Instanz (getIscDBHandle) from a JBoss MBean via
FBManagedConnection and invalidated the handle (methode invalidate).

Doing this, we got a situation with db.out == null --> this seems to be
the situation our customer has.

Now each DB access (via a webservice with LocalTransaction) leads to a
NPE.

This NPE stops upon accessing the DB via a XATransaction (from a Message
Driven Bean).
In this case the first access also brings a NPE which throws a
"org.firebirdsql.jca.FBXAException: Unrecognized transaction".
Upon this exception the MDB tries it once again and this time a new
connection is created within the pool. After this moment all
webservice-calls work again until ??? (for 1 day or even 2 weeks)


Now the questions:
==================
Can you think of a situation where a isc_db_handle instance is invalid
(db.out == null)?
Could it be a synchronization problem in JBoss or Jaybird?

Thank you very much for your help,
Josef Gschwendtner