From mscott at springfieldtech.com Thu Jun 1 14:48:53 2006 From: mscott at springfieldtech.com (Matthew Scott) Date: Thu, 1 Jun 2006 07:48:53 -0500 Subject: [DB-SIG] [ANN] Schevo 2006 June Software Release Message-ID: <9883CA12-4943-49D8-8C4B-491335ECAA72@springfieldtech.com> =================================== Schevo 2006 June Software Release =================================== Orbtech, L.L.C. and the Schevo team are pleased to announce the availability of the 2006 June software release of Schevo and related support packages. Details and installation information are available at: http://schevo.org/trac/wiki/SoftwareRelease-2006-06 General information about Schevo is available at: http://schevo.org/ Upgrades in this release ======================== * Schevo 3.0b2 New packages in this release ============================ * SchevoDot 1.0a1 * SchevoGears 1.0a1 * SchevoGtk 1.0a1 * SchevoSql 1.0a1 * SchevoWeb 1.0a1 * SchevoXml 1.0a1 What is Schevo ============== Schevo is a next-generation DBMS that focuses on the following: * **Rapid Development**: Schevo includes features to make it easy and fun to create even the most complex of databases. Not only is the schema syntax easy to write and understand, you can also quickly place initial values in your schema that are required by your database, and use the same syntax to create sets of sample data to use during development. * **User Interface Generation**: Schevo provides user interface toolkits that take advantage of the richness of the database schema. You can use the full-featured Schevo Navigator to interact with your database without writing a single line of code outside of your database schema. A PyQt-based toolkit is already available, and PyGtk and TurboGears toolkits are in the works. * **Rich Schema Definition**: The schema for a Schevo database is written in concise, easy-to-read Python code. Not only does the schema describe how information in the database is structured, but also defines all transactions and rules that ensure database integrity. * **Automated Schema Evolution**: Once a Schevo database is deployed and is used to store valuable data, you will inevitably make further changes to the structure of the database. Schevo assists you in this task and makes it easy to restructure a database and facilitate the migration of data from one schema version to the next. * **Transaction Based**: Schevo is designed from the ground up to protect your data. All changes to a Schevo database must be done using transactions, and Schevo ensures that those transactions always leave the database in a consistent state. -- Matthew Scott mscott at springfieldtech.com From szybalski at gmail.com Wed Jun 7 18:28:12 2006 From: szybalski at gmail.com (Lukasz Szybalski) Date: Wed, 7 Jun 2006 11:28:12 -0500 Subject: [DB-SIG] [parameter substitution] how to escape perecent? Message-ID: <804e5c70606070928g42cd749exa0d10a1b01ca2823@mail.gmail.com> I am doing a parameter substitution, but when I execute the following statement I get an error. Could you tell me how should i escape % signs? sql="select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%Y %M %d,%H:%i') from my_table where my_table.from_email=%s" then c.execute(sql,('myemail at mydomain')) or c.execute(sql,(email)) I get an error : Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/MySQLdb/cursors.py", line 137, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue ValueError: unsupported format character 'Y' (0x59) at index 59 Thank You Lucas From cdamundsen at gmail.com Wed Jun 7 18:51:51 2006 From: cdamundsen at gmail.com (Craig Amundsen) Date: Wed, 7 Jun 2006 09:51:51 -0700 Subject: [DB-SIG] [parameter substitution] how to escape perecent? In-Reply-To: <804e5c70606070928g42cd749exa0d10a1b01ca2823@mail.gmail.com> References: <804e5c70606070928g42cd749exa0d10a1b01ca2823@mail.gmail.com> Message-ID: <8dc0c28f0606070951y7f641d9fq1cb17c7547081c09@mail.gmail.com> Hi - I am doing a parameter substitution, but when I execute the following > statement I get an error. Could you tell me how should i escape % > signs? > > sql="select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%Y %M > %d,%H:%i') from my_table where my_table.from_email=%s" > > then > c.execute(sql,('myemail at mydomain')) > or > c.execute(sql,(email)) >>> sql="select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%%Y %%M %%d,%%H:%%i') from my_table where my_table.from_email=%s" % ' myaddress at mydomain.com' >>> sql "select DATE_FORMAT(FROM_UNIXTIME(my_table.received_date),'%Y %M %d,%H:%i') from my_table where my_table.from_email=myaddress at mydomain.com" - Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20060607/11bc20dd/attachment.html From stuart at stuartbishop.net Thu Jun 22 07:58:53 2006 From: stuart at stuartbishop.net (Stuart Bishop) Date: Thu, 22 Jun 2006 12:58:53 +0700 Subject: [DB-SIG] Two phase commit API Message-ID: <449A319D.5030903@stuartbishop.net> Hi. Are there any drivers out there that support two phase commit. If so, what syntax do they use? Is it worth adding a standard API for this as an optional extension to the DB-API 2.0? Enough backends now support this that I suspect it is worth doing this now to avoid unnecessary incompatibilities between backend specific database APIs. -- Stuart Bishop http://www.stuartbishop.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 191 bytes Desc: OpenPGP digital signature Url : http://mail.python.org/pipermail/db-sig/attachments/20060622/d4665007/attachment.pgp From mal at egenix.com Thu Jun 22 09:37:47 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 22 Jun 2006 09:37:47 +0200 Subject: [DB-SIG] Two phase commit API In-Reply-To: <449A319D.5030903@stuartbishop.net> References: <449A319D.5030903@stuartbishop.net> Message-ID: <449A48CB.1050501@egenix.com> Stuart Bishop wrote: > Hi. > > Are there any drivers out there that support two phase commit. > > If so, what syntax do they use? I'm not aware of any native driver that does support this, except a patched DCOracle2: http://pymqi.sourceforge.net/ You can also use mxODBC with an XA enabled ODBC driver (I think the EasySoft Oracle ODBC driver is capable of doing XA), but the APIs for setting this up are different for each driver. > Is it worth adding a standard API for this as an optional extension to the > DB-API 2.0? Enough backends now support this that I suspect it is worth > doing this now to avoid unnecessary incompatibilities between backend > specific database APIs. I'm not sure I can follow you here: if you do two-phase commit under the control of a transaction manager such as MQSeries or MS DTS, then the transaction manager will take care of the transaction, not the database interface (see e.g. the DCOracle2 XA example in http://pymqi.sourceforge.net/). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun 22 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2006-07-03: EuroPython 2006, CERN, Switzerland 10 days left ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From davidrushby at yahoo.com Thu Jun 22 14:28:08 2006 From: davidrushby at yahoo.com (David Rushby) Date: Thu, 22 Jun 2006 05:28:08 -0700 (PDT) Subject: [DB-SIG] Two phase commit API In-Reply-To: <449A319D.5030903@stuartbishop.net> Message-ID: <20060622122808.86493.qmail@web30002.mail.mud.yahoo.com> --- Stuart Bishop wrote: > Are there any drivers out there that support two phase commit. KInterbasDB does. > If so, what syntax do they use? The Connection class has a prepare method that triggers the first phase of two-phase commit. The normal commit method then performs the second phase. There's also a ConnectionGroup class that makes it more convenient to deal with a group of Connections that are all participating in the same distributed transaction. Here's an example: --- import kinterbasdb # Establish multiple connections the usual way: con1 = kinterbasdb.connect(dsn='weasel:/temp/test.db', user='sysdba', password='pass') con2 = kinterbasdb.connect(dsn='coyote:/temp/test.db', user='sysdba', password='pass') # Create a ConnectionGroup to associate multiple connections in such a # way that they can participate in a distributed transaction. group = kinterbasdb.ConnectionGroup(connections=(con1,con2)) # Start a distributed transaction involving all of the members of # the group (con1 and con2 in this case) with one of the following # approaches: # - Call group.begin() # - Call con1.begin(); the operation will "bubble upward" and # apply to the group. # - Call con2.begin(); the operation will "bubble upward" and # apply to the group. # - Just start executing some SQL statements on either con1 or con2. # A transaction will be started implicitly; it will be a # distributed transaction because con1 and con2 are members # of a ConnectionGroup. group.begin() # Perform some database changes the usual way (via cursors on con1 and con2): ... # Commit or roll back the distributed transaction by calling the # commit or rollback method of the ConnectionGroup itself, or the # commit or rollback method of any member connection (con1 or # con2 in this case). group.commit() # Unless you want to perform another distributed transaction, # disband the group so that member connections can operate # independently again. group.clear() --- __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From stuart at stuartbishop.net Tue Jun 27 09:03:11 2006 From: stuart at stuartbishop.net (Stuart Bishop) Date: Tue, 27 Jun 2006 14:03:11 +0700 Subject: [DB-SIG] Two phase commit API In-Reply-To: <449A48CB.1050501@egenix.com> References: <449A319D.5030903@stuartbishop.net> <449A48CB.1050501@egenix.com> Message-ID: <44A0D82F.1030202@stuartbishop.net> M.-A. Lemburg wrote: > Stuart Bishop wrote: >> Hi. >> >> Are there any drivers out there that support two phase commit. >> >> If so, what syntax do they use? > > I'm not aware of any native driver that does support this, except a > patched DCOracle2: > > http://pymqi.sourceforge.net/ > > You can also use mxODBC with an XA enabled ODBC driver (I think > the EasySoft Oracle ODBC driver is capable of doing XA), but the > APIs for setting this up are different for each driver. > >> Is it worth adding a standard API for this as an optional extension to the >> DB-API 2.0? Enough backends now support this that I suspect it is worth >> doing this now to avoid unnecessary incompatibilities between backend >> specific database APIs. > > I'm not sure I can follow you here: if you do two-phase commit > under the control of a transaction manager such as MQSeries > or MS DTS, then the transaction manager will take care of > the transaction, not the database interface (see e.g. the DCOracle2 > XA example in http://pymqi.sourceforge.net/). My objective is to add the functionality to psycopg now that PostgreSQL supports two phase commit. I'm not interested in using a third party transaction manager - just something like the following (using KInterbaseDB prepare() method - thanks David): >>> con1 = connect('dbname=db1') >>> con2 = connect('dbnane=db2') [ Make changes to both databases ] >>> # These prepares may raise exceptions if database limits are >>> # reached or serialization exceptions raised from running in >>> # serializable transaction isolation level. >>> con1.prepare() >>> con2.prepare() >>> # These commits guaranteed to succeed except in extraordinary >>> # circumstances. >>> con1.commit() >>> con2.commit() This can also be used to correctly hook the database adapters into Zope or other transactional systems that support two phase commit to avoid the rare but possible data corruption that can occur when dealing with multiple databases. -- Stuart Bishop http://www.stuartbishop.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 191 bytes Desc: OpenPGP digital signature Url : http://mail.python.org/pipermail/db-sig/attachments/20060627/02ba690f/attachment.pgp