I did use Resin's connection pooling and validation query. Here is my
configuration in resin.conf. The sysusers is the system table of MS SQL Server.
Still, I am getting errors...
Any clue?
<web-app id='/espresso' document-directory='c:\java\espresso\web'>
<database>
<jndi-name>jdbc/DefaultDS</jndi-name>
<driver type="com.jnetdirect.jsql.JSQLDriver">
<url>jdbc:JSQLConnect://192.168.0.200/database="espresso"</url>
<user>username</user>
<password>password</password>
</driver>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
<max-connections>100</max-connections>
<max-idle-time>30s</max-idle-time>
<max-active-time>600s</max-active-time>
<max-pool-time>600s</max-pool-time>
<connection-wait-time>10s</connection-wait-time>
<max-overflow-connections>0</max-overflow-connections>
<ping-table>sysusers</ping-table>
<ping>true</ping>
<ping-interval>60s</ping-interval>
<spy>false</spy>
</database>
</web-app>
-----Original Message-----
From: Martin Kalen [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 09, 2005 10:03 PM
To: OJB Users List
Subject: Re: java.lang.NullPointerException after calling
getCollectionFromQuery()
Christopher Cheng wrote:
> I found the following exception after running the web application for days.
<snip/>
> Caused by: java.lang.NullPointerException
> at com.jnetdirect.jsql.am.clearParameters(Unknown Source)
This is a JDBC-driver exception and is probably caused by a server-side dropped
Connection object getting reused from pool due to a missing validation query.
You need a validation query for your connection pool to avoid this.
Since you are using a DataSource, you cannot directly specify the validation
query in OJB - instead you will have to configure you DataSource to use it.
However, since the concept of a validation query also applies when using
OJB connection pooling you can google for [ojb "validation query"] to get
some recent user-list discussions regarding this.
A direct link to a recent thread:
http://www.mail-archive.com/[email protected]/msg13521.html
You can use the same validation query (ie "SELECT 1") for MS SQL Server
as the specified MySQL example.
Since your stacktrace shows "com.caucho.sql" I take it that you use
Resin for your DataSource definition and connection pooling?
If so, check Resin docs for how to configure the validation query:
http://www.caucho.com/resin-3.0/db/config.xtp#Core-Configuration
http://www.caucho.com/resin-3.0/db/config.xtp#reliability
(The concept of performing 'validation queries' seems to be called
"pinging" in Caucho terminology. It also seems that ping="true" equals
Apache Commons Pool setting of testOnBorrow="true".)
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]