Subject Re: [Firebird-Java] Sporadic NullPointerException with Jaybird used from JBoss
Author Joachim Van der Auwera
Josef Gschwendtner wrote:
> Hi,
>
> we use JBoss and Jaybird to connect to a Firebird 1.03 database.
> Preparing a statement (stored procedure) produces sporadically a
> NullPointerException.
> The server is under heavy load (> 10 transactions per second).

Best to use a definition like (note this is JBoss 4.0, may need some
tweaking for older versions).

<tx-connection-factory>

<jndi-name>ICtraceDS</jndi-name>
<xa-transaction/>
<track-connection-by-tx/>
<rar-name>10firebirdsql.rar</rar-name>
<connection-definition>javax.sql.DataSource</connection-definition>
<adapter-display-name>Firebird Database
Connector</adapter-display-name>
<config-property name="Database"
type="java.lang.String">localhost/3050:/data/ic-trace/ic-trace.fdb</config-property>
<user-name>sysdba</user-name>
<password>masterkey</password>

<min-pool-size>0</min-pool-size>
<check-valid-connection-sql>SELECT CAST(1 as INTEGER) FROM
rdb$database</check-valid-connection-sql>

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

Especially the check-valid-connection-sql is important for your problem
(been there too).

Joachim