• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Weird problem when using connection pool

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic