[CDBI] MySQL and transactions

Justin Guenther jguenther at gmail.com
Thu Nov 10 22:31:08 GMT 2005


Hello,

I am using Class::DBI::mysql in transactional mode (i.e. AutoCommit=0), and
have come across a peculiarity/bug.

Even with autocommit disabled, creating an object (i.e.
Class->create({...})) inserts a row into the database before I do a
dbi_commit(). No error messages or warnings are issued, it just silently
inserts into the database.

Basically, I have several classes that have a has-many relationship with
eachother, so if one fails to be created I don't want to have several other
half-constructed objects sitting around -- which is why I wanted to have to
manually commit everything when I'm satisfied it's done.

Am I misunderstanding something about how AutoCommit works?

Thanks,
Justin Guenther
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20051110/4c950421/attachment.html


More information about the ClassDBI mailing list