• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMP and JDBC

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have inherited code where I have a bean (stateless session) where all it's remote methods use container managed transactions. Inside some of these methods JDBC is used directly, with auto-commit turned on(assuming thats the default in weblogic 10.x).
Further ,there are explicit connection.commit at some places - and a connection.preparestament('begin transaction')/('end transaction') execution at others.

Do these JDBC statements subvert the CMP configuration?
What do I need to ensure if I am reviewing this code in terms of sanity?

(I am assuming that in case of BMP - the JDBC connection settings hold supreme anyways.)
 
Claude Moore
Ranch Hand
Posts: 817
7
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems very strange to mix up container managed transactions and autocommit. Moreover, I would expect that a call to commit() or rollback() method on a connection object inside a method with CMT would make the container complain about it throwing some exceptions (like "illegal state exception"), so If I were you I would try to review the code avoiding manual tx handling in a CMT context.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic