aspose file tools*
The moose likes JDBC and the fly likes Weird problem when using connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Weird problem when using connection pool" Watch "Weird problem when using connection pool" New topic
Author

Weird problem when using connection pool

Mike Sven
Greenhorn

Joined: Nov 14, 2002
Posts: 2
I've encountered one problem when using weblogic connection pool by data source. I'm trying to use that connection to insert record but if using connection pool, when calling preparedStatementexecute(), it will throw unique constraint for PK of that table, although actually only insert 1 record. However if using direct jdbc connection, the record can be inserted. Is it due to some statement cache on connection pool side or something else?...really confused for this case.
Thanks a lot for any help or hint from you masters.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2712
    
    5

"boyofsea " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.


SCJP, SCWCD.
|Asking Good Questions|
ken zhu
Greenhorn

Joined: Apr 09, 2009
Posts: 20
Mike Sven,

could you paste your relevant sourcecode and DB & APP server version?
Mike Sven
Greenhorn

Joined: Nov 14, 2002
Posts: 2
Actually there are two things in this case. First of all it is basic issue. The record was inserted at the first time, but could not be retrieved due to format of date, so after run app at the second time(with same data) it threw exception. In some other env, it only insert "dd/MM/yyyy", but in current testing env, its format is "dd/MM/yyyy hh:mi:ss". Secondly, in source code it has such line: pstmt.setTimeStamp((Timestamp)value); that is working with JDBC direct connection(only insert date without time), but after changing to use pool, the default format looks changed, so have to use: pstmt.setDate(j+1, new java.sql.Date(((Timestamp)value).getTime())); to only insert date. Have you encountered such case before?
John Kimball
Ranch Hand

Joined: Apr 13, 2009
Posts: 96
Which database/DBMS?

Edit: And is your pool using the same exact JDBC driver (version, etc.) as your direct-connection test?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weird problem when using connection pool
 
Similar Threads
how to return multiple row from oracle 9i procedure
use of serail key (auto increment)
Connection Pooling-Urgent
Connection Pooling - Urgent
using last_insert_id() mysql statement in tomcat