On Friday January 04, 2002 03:50 am, Stefan Karlsson wrote:
> On Sun, 30 Dec 2001 20:14:33 -0800, Chuck Esterbrook wrote:
> >On Friday 28 December 2001 12:03 pm, Stefan Karlsson wrote:
> >>�Tip: If you want to have very simple MK/MySQL support of
> >>transactions
> >>�you can do like this (at least it works for me :-).
> >>
> >>�1) Subclass MySQLObjectStore and override saveChanges:
> >>
> >>�class MyMySQLObjectStore(MySQLObjectStore):
> >>���def saveChanges(self):
> >>�����self.executeSQL('BEGIN')
> >>�����try:
> >>�������MySQLObjectStore.saveChanges(self)
> >>�����except Exception, e:
> >>�������self.executeSQL('ROLLBACK')
> >>�������raise e
> >>�����else:
> >>�������self.executeSQL('COMMIT')
> >
> >Should this also be a setting?
>
> Maybe a good idea
>
> >����'SQLSaveChanges': ['BEGIN', 'ROLLBACK', 'COMMIT'],
> >
> >Or are these always the same? So then:
> >
> >����'SQLCommitOrRollBack': 1,
> >
> >(Most of my experience is with MySQL so I'm less familar with other
> >db's.)
>
> BEGIN, ROLLBACK and COMMIT also work in Postgres, don't know about other
> db's.I'm pretty sure MS SQL Server requires "BEGIN TRAN" or "BEGIN TRANSACTION", not just "BEGIN". Same for ROLLBACK and COMMIT. - Geoff _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
