Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Weird problem when using connection pool

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"boyofsea " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike Sven,

could you paste your relevant sourcecode and DB & APP server version?
 
Mike Sven
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which database/DBMS?

Edit: And is your pool using the same exact JDBC driver (version, etc.) as your direct-connection test?
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic