RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-30 Thread Raible, Matt
I've discovered that this problem is related to a 90-minute timeout on our
firewall.  Tomcat sits outside of the firewall, and Oracle resides inside.
Since there's no activity for 90 minutes, it closes the connection.  Anyone
know of a workaround (+ sample code) for this?  I'm assuming a ping of some
sort using the database connection pool would work.

Thanks,

Matt

 -Original Message-
 From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 29, 2003 10:03 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Can the JNDI Connection Pool re-connect after failure?
 
 
 I don't have any timeout settings set. I'm also not using the driver
 from Oracle. I'm using a third party driver from inetsoftware.de. If
 it's not working in 24 hours, I'll let your know.
 
 Ryan
 
 
  [EMAIL PROTECTED] 01/29/03 09:43AM 
 Will it work for 24 hours is the question... ;) If it does, maybe I
 should
 change to a different Oracle JDBC Driver.  Do you have any timeout
 limitations set on the connecting user?  We do, and I'm wondering if
 that's
 causing my problems.
 
 Thanks,
 
 Matt
 
 
 -
 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]




Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-30 Thread Nikola Milutinovic
Raible, Matt wrote:

I've discovered that this problem is related to a 90-minute timeout on our
firewall.  Tomcat sits outside of the firewall, and Oracle resides inside.
Since there's no activity for 90 minutes, it closes the connection.  Anyone
know of a workaround (+ sample code) for this?  I'm assuming a ping of some
sort using the database connection pool would work.


SOLUTION 1: Change timeout values on your firewall.
SOLUTION 2: Create a load-on-startup servlet that will ping the database every 
hour.

Nix.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Nikola Milutinovic
Boris Folgmann wrote:

Ryan Cornia wrote:



Anyone using JNDI datasources that reconnect in case of a lost link to
the DB server?

Any examples? I'm using the I-net driver for Oracle



Interesting question. In fact I have the same problem, using DBCP and
PostgreSQL. I looked trough the Javadocs at
http://jakarta.apache.org/commons/dbcp/api/index.html
but did not find a resource argument for configuring something like a
reconnect. Any comments welcome.


I believe that if you set up connection verification query in your DataSource 
definition in server.xml it will reconnect. Haven't tried it, though.

Nix.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Boris Folgmann
Nikola Milutinovic wrote:

 I believe that if you set up connection verification query in your DataSource 
 definition in server.xml it will reconnect. Haven't tried it, though.

Do you know that it was made for this purpose or are you simpley guessing
from the Javavdoc?

--
protected java.lang.String validationQuery

The SQL query that will be used to validate connections from this pool
before returning them to the caller. If specified, this query MUST be an
SQL SELECT statement that returns at least one row.
---

cu,
boris
-- 
Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
Folgmann IT-Consulting  http://www.folgmann.de


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Raible, Matt
I've tried adding the following and I still have the same problem as Ryan.  
parameter
namevalidationQuery/name
valueSELECT 1 FROM DUAL/value
/parameter

When I check my 4.1.18 Tomcat server every morning I get:

WARN [Ajp13Processor[11009][7]] JDBCExceptionReporter.logExceptions(35) |
SQL Error: 0, SQLState: null
ERROR [Ajp13Processor[11009][7]] JDBCExceptionReporter.logExceptions(42) |
Cannot load JDBC driver class 'null'
WARN [Ajp13Processor[11009][7]] SessionFactoryImpl.init(163) | Could not
obtain connection metadata
java.sql.SQLException: Cannot load JDBC driver class 'null'
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:529)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
at
cirrus.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas
ourceConnectionProvider.java:56)

Could this be from closing connections in a finally block?  This should just
return them to the pool right?

Thanks,

Matt

 -Original Message-
 From: Nikola Milutinovic [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 29, 2003 2:09 AM
 To: Tomcat Users List
 Subject: Re: Can the JNDI Connection Pool re-connect after failure?
 
 
 Boris Folgmann wrote:
  Ryan Cornia wrote:
  
  
 Anyone using JNDI datasources that reconnect in case of a 
 lost link to
 the DB server?
 
 Any examples? I'm using the I-net driver for Oracle
  
  
  Interesting question. In fact I have the same problem, 
 using DBCP and
  PostgreSQL. I looked trough the Javadocs at
  http://jakarta.apache.org/commons/dbcp/api/index.html
  but did not find a resource argument for configuring 
 something like a
  reconnect. Any comments welcome.
 
 I believe that if you set up connection verification query 
 in your DataSource 
 definition in server.xml it will reconnect. Haven't tried it, though.
 
 Nix.
 
 
 
 -
 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]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Ryan Cornia
This solution seems to work great for me. After adding this and
re-booting the database server, it re-connected and worked great
automatically

Thanks a ton Nix.

Ryan


 [EMAIL PROTECTED] 01/29/03 07:11AM 
I've tried adding the following and I still have the same problem as
Ryan.  
parameter
namevalidationQuery/name
valueSELECT 1 FROM DUAL/value
/parameter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Raible, Matt
Will it work for 24 hours is the question... ;) If it does, maybe I should
change to a different Oracle JDBC Driver.  Do you have any timeout
limitations set on the connecting user?  We do, and I'm wondering if that's
causing my problems.

Thanks,

Matt

 -Original Message-
 From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 29, 2003 7:49 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Can the JNDI Connection Pool re-connect after failure?
 
 
 This solution seems to work great for me. After adding this and
 re-booting the database server, it re-connected and worked great
 automatically
 
 Thanks a ton Nix.
 
 Ryan
 
 
  [EMAIL PROTECTED] 01/29/03 07:11AM 
 I've tried adding the following and I still have the same problem as
 Ryan.  
 parameter
 namevalidationQuery/name
 valueSELECT 1 FROM DUAL/value
 /parameter
 
 
 
 -
 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]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Ryan Cornia
I don't have any timeout settings set. I'm also not using the driver
from Oracle. I'm using a third party driver from inetsoftware.de. If
it's not working in 24 hours, I'll let your know.

Ryan


 [EMAIL PROTECTED] 01/29/03 09:43AM 
Will it work for 24 hours is the question... ;) If it does, maybe I
should
change to a different Oracle JDBC Driver.  Do you have any timeout
limitations set on the connecting user?  We do, and I'm wondering if
that's
causing my problems.

Thanks,

Matt


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Boris Folgmann
Ryan Cornia wrote:
 This solution seems to work great for me. After adding this and
 re-booting the database server, it re-connected and worked great
 automatically

Same for me. It works too with postgresql. It would be interesting to know
how big the overhead is for this check. Is the check done before EVERY
query? Anyway, I used an even simpler valueSELECT 1;/value which does
not need to read any table but returns a row as requested in the Javadoc.

cu,
boris

-- 
Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
Folgmann IT-Consulting  http://www.folgmann.de


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread fred
Ok Thank you very much...
I'm  going to test that...

- Original Message - 
From: Ryan Cornia [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 3:48 PM
Subject: RE: Can the JNDI Connection Pool re-connect after failure?


 This solution seems to work great for me. After adding this and
 re-booting the database server, it re-connected and worked great
 automatically
 
 Thanks a ton Nix.
 
 Ryan
 
 
  [EMAIL PROTECTED] 01/29/03 07:11AM 
 I've tried adding the following and I still have the same problem as
 Ryan.  
 parameter
 namevalidationQuery/name
 valueSELECT 1 FROM DUAL/value
 /parameter
 
 
 
 -
 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]




Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-29 Thread Jakarta
yuo're right the validationQuery is done before every query. but is
implemented any keepalive protocol to mantain a persistent connection (i
guess no)

- Original Message -
From: Boris Folgmann [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Wednesday, January 29, 2003 3:55 PM
Subject: Re: Can the JNDI Connection Pool re-connect after failure?


 Ryan Cornia wrote:
  This solution seems to work great for me. After adding this and
  re-booting the database server, it re-connected and worked great
  automatically

 Same for me. It works too with postgresql. It would be interesting to know
 how big the overhead is for this check. Is the check done before EVERY
 query? Anyway, I used an even simpler valueSELECT 1;/value which does
 not need to read any table but returns a row as requested in the Javadoc.

 cu,
 boris

 --
 Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
 Folgmann IT-Consulting  http://www.folgmann.de


 -
 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]




Can the JNDI Connection Pool re-connect after failure?

2003-01-28 Thread Ryan Cornia
I have set a JNDI connection pool up in server.xml that works, however
if the database server goes down, it doesn't re-connect when it comes
back up. 

Anyone using JNDI datasources that reconnect in case of a lost link to
the DB server?

Any examples? I'm using the I-net driver for Oracle.

Thanks,
Ryan




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Can the JNDI Connection Pool re-connect after failure?

2003-01-28 Thread Boris Folgmann
Ryan Cornia wrote:

 Anyone using JNDI datasources that reconnect in case of a lost link to
 the DB server?
 
 Any examples? I'm using the I-net driver for Oracle

Interesting question. In fact I have the same problem, using DBCP and
PostgreSQL. I looked trough the Javadocs at
http://jakarta.apache.org/commons/dbcp/api/index.html
but did not find a resource argument for configuring something like a
reconnect. Any comments welcome.

cu,
boris

-- 
Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
Folgmann IT-Consulting  http://www.folgmann.de


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-28 Thread Shapira, Yoav
Howdy,
This would likely be an implementation detail, not specified by the JNDI
interface contract (at least at this point in time).  In fact, an
implementation that does this would claim it as a competitive advantage.

I believe the Oracle JDBC driver and connection pool (ojdbc14.jar in the
Oracle JDBC 9.2.0.1 downloaded) does do this type of thing, or at least
claims to do it.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Boris Folgmann [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 11:57 AM
To: Tomcat Users List
Subject: Re: Can the JNDI Connection Pool re-connect after failure?

Ryan Cornia wrote:

 Anyone using JNDI datasources that reconnect in case of a lost link
to
 the DB server?

 Any examples? I'm using the I-net driver for Oracle

Interesting question. In fact I have the same problem, using DBCP and
PostgreSQL. I looked trough the Javadocs at
http://jakarta.apache.org/commons/dbcp/api/index.html
but did not find a resource argument for configuring something like a
reconnect. Any comments welcome.

cu,
   boris

--
Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
Folgmann IT-Consulting  http://www.folgmann.de


--
To unsubscribe, e-mail:   mailto:tomcat-user-
[EMAIL PROTECTED]
For additional commands, e-mail: mailto:tomcat-user-
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-28 Thread Sean Dockery
With the MySQL driver, you can configure the driver to AutoReconnect a
la...


ResourceParams ...

  ...

  parameter
nameAutoReconnect/name
valuetrue/value
  /parameter

  ...

/ResourceParams


I'm not sure whether the parameter functions as a Tomcat datasource
parameter or MySQL driver parameter.  I've never done it with an Oracle
driver.

-Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 07:43
To: 
Subject: Can the JNDI Connection Pool re-connect after failure?


I have set a JNDI connection pool up in server.xml that works, however
if the database server goes down, it doesn't re-connect when it comes
back up.

Anyone using JNDI datasources that reconnect in case of a lost link to
the DB server?

Any examples? I'm using the I-net driver for Oracle.

Thanks,
Ryan






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Can the JNDI Connection Pool re-connect after failure?

2003-01-28 Thread Ryan Cornia
It must be a MySQL driver parameter, because it did not work for my
oracle driver.

Ryan

 [EMAIL PROTECTED] 01/28/03 11:19AM 
With the MySQL driver, you can configure the driver to AutoReconnect
a
la...


ResourceParams ...

  ...

  parameter
nameAutoReconnect/name
valuetrue/value
  /parameter

  ...

/ResourceParams


I'm not sure whether the parameter functions as a Tomcat datasource
parameter or MySQL driver parameter.  I've never done it with an
Oracle
driver.

-Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 28, 2003 07:43
To: 
Subject: Can the JNDI Connection Pool re-connect after failure?


I have set a JNDI connection pool up in server.xml that works, however
if the database server goes down, it doesn't re-connect when it comes
back up.

Anyone using JNDI datasources that reconnect in case of a lost link to
the DB server?

Any examples? I'm using the I-net driver for Oracle.

Thanks,
Ryan






--
To unsubscribe, e-mail:  
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]