20030117 Friday January 17, 2003

Connection Timeout using Oracle with Tomcat Hopefully one of you java-bloggers has seen this before and can assist. I've already sent this to tomcat-users, but since this blog seems to be more google-friendly than mailing lists - I like to post problems/solutions here. Hope you don't mind.

I am using Tomcat's JDBCRealm as well as a DBCP Connection pool. I am connecting to Oracle 9, and everything works fine - for about 24 hours. I've experienced this with MySQL and adding autoReconnect=true to the connectionURL fixed the problem. However, adding this to Oracle's connectionURL causes a "Cannot load JDBC driver class 'null'". My connectionURL is:

jdbc:oracle:thin:username/password@host:1521:sid

Posted in Java at Jan 17 2003, 09:34:18 AM MST 3 Comments

Comments:

Strange JDBC URL... Our Oracle JDBC URL are: jdbc:oracle:thin:@<host>:<port>:<sid> i.e. no username/password.

Posted by Sebastiano Pilla on January 17, 2003 at 11:03 AM MST #

I agree with you, and in my DBCP Connection Pool setup, this is what I use. However, in Tomcat's JDBCRealm - this is the (correct) syntax to set it up for Oracle.

Posted by Matt Raible on January 17, 2003 at 01:03 PM MST #

I enabled the checking in the Tomcat realm, by adding a validation query to the server.xml <parameter> <name>validationQuery</name> <value>select * from dual</value> </parameter> since then it worked. If you do a "select sid, username from v$session;" in SQLPlus, you will see the SID increasing every now and then, meaning that the DBCP was reconnecting.

Posted by Anonymous on March 07, 2003 at 08:00 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« December 2008
SunMonTueWedThuFriSat
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
       
Today

Recent Entries

Tag Cloud