File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes transaction .... shmansaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "transaction .... shmansaction" Watch "transaction .... shmansaction" New topic
Author

transaction .... shmansaction

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Howdy all,

I'm taking my first stab at using transactions with JDBC code. I found this article from sun, but the code's not working for me:




I used a debugger to confirm that the rollback() method is getting executed, but I still end up with new DB rows.

I'm using MySQL for my DB. Could that be the problem? I'd appreciate any advice that the ranchers may have.


Fun programming etcetera!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I'm using MySQL for my DB. Could that be the problem?

Probably. If you want to use transactional stuff you need to make sure you are using a database which supports them. Some of the MySQL database engines (including the default ISAM) amazingly don't. Create your table using one of the db engines that supports transactions and you should be OK.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bryan Scarbrough
Ranch Hand

Joined: Aug 08, 2005
Posts: 49
Probably. If you want to use transactional stuff you need to make sure you are using a database which supports them.


MySQL 4.0.x.x does support transactions, BUT, you must use the InnoDB table type.


Bryan Scarbrough<br /> <br />Consistency is the last resort of the unimaginative!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: transaction .... shmansaction