RE: Error in ct_options
| Newsgroups | gmane.comp.python.sybase |
|---|---|
| Message-ID | <71E7879B20E1C84B9055F73AD9B79CD8229C18@msg1-il.integration.sungard.corp> |
Hi, The Sybase equivalent of 'set implicit_transactions on' is 'set chained on'. This might work on MSSQL too -- I don't have one on me... But you may still activate the feature in very similar ways (executing a statement) rather than very different ones (statement vs. setting a connection property). In any case, I think if you fail to set up chained transactions you should definitely not "just ignore it quietly"; this would be very un-pythonic. You should let the user allow it to be quietly ignored, or have an option to explicitly connect in auto-commit mode, but not as default. Having a connection succeed, but use a subtly different semantics than the user expects (because of the DBAPI spec, and the fact that Sybase/MSSQL do support chained mode), is just asking for trouble. My 2 cents, Shai. -----Original Message----- From: Dave Cole [mailto:[email protected]] Sent: Friday, January 24, 2003 15:11 To: Marcos Sánchez Provencio Cc: [email protected] Subject: Re: [python-sybase] Error in ct_options > First, thank you for the module in general and for the fast answer in > particular. > > I suppose you meant > - if status != CS_SUCCEED: > - self._raise_error(Error, 'ct_options') > + self.auto_commit = (status != CS_SUCCEED) > ^^^^^^ > > Well, now it connects alright, but I don't get auto-commit off, do I? > I do want standard dbapi behavior. > > Would it be ok to just execute > c.execute('set implicit_transactions on') on the connection? Does anyone know if there is a standard way to disable auto commit on both Sybase and SQL Server? - Dave -- http://www.object-craft.com.au _______________________________________________ Python-sybase mailing list [email protected] https://object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase