On Thu, Jan 04, 2007 at 10:45:49 +0100, Xavier Robin wrote: > But is it safe?
As everyone else said - use the method DBIC provided for you, it is more robust since you don't have anything to remember. However, you still have to be aware of the ACID semantics of your DB, because they may be on crack. IIRC postgresql is actually one of the good guys in terms of this. MySQL before version 5 (or was it 4.1?) was naughty. The problem is that if two transactions simultaneously try to add conflicting data (with relationships) there might be a consistency issue. In any case, if the DB cannot sanely accomodate this (no DB can always guarantee that merging the transaction will work) you still have to be prepared to catch the death triggered by the transaction's commit. In most cases you can simply try it again, but be sure to reload any objects which may have been modified by another transaction, that you have loaded before the BEGIN. I'm kind of digressing into handwaving here, because this is a gray area to most users (including me). Consult your database docs for more authoritative advice. -- Yuval Kogman <[EMAIL PROTECTED]> http://nothingmuch.woobling.org 0xEBD27418
pgpaHHPHTY3zZ.pgp
Description: PGP signature
_______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
