On Wed, 2004-11-10 at 10:41 +0100, Uwe Grauer wrote: > I took a look on MiddleKit, but thought that the transaction control > isn't really there. > This seems to be the reason, that MiddleKit dosn't support transaction > oriented Databases. > Most People are using mysql with MiddleKit!? > Is there any Form of transaction control now in MiddleKit svn?
You can use MiddleKit with databases which support transactions, but MiddleKit doesn't let you actually take advantage of database-level transactions. When you add or change a MiddleKit object, that object is marked "dirty" for that thread. The next time you call store.saveChanges(), all dirty objects for that thread are committed to the database. It's possible that an object could be modified by two threads simultaneously; in this case the second thread to set an attribute would overwrite the change made by the first thread. Whichever thread calls store.saveChanges() first would cause the database to be updated. MiddleKit offers no mechanism for "locking" objects or rolling-back changes. In practice, these limitations have not been issues for the applications I have written, but this needs to be evaluated for each application. If you need transaction support and want to use an ORM, I'd suggest looking at SQLObject (http://sqlobject.org) or Modeling (http://modeling.sf.net). Whereas MiddleKit caches objects and ensures that there is only one python object in a process corresponding to a given database record, it appears that SQLObject creates multiple python-objects for a given record (if for example two threads try to fetch the same object, each using their own database connection). This is reasonable, since a fetch-update-commit operation would most likely be performed by the same thread, and allows you to use database-level transactions with SQLObject. Modeling has a more complex design, which includes the concept of an "Editing Context" (which I take to be an abstraction for a transaction), and IIRC does allow you to lock objects. I have never tried it out though, so I can't comment on how well it works in practice. peace, Jason > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Webware-discuss mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/webware-discuss > !DSPAM:4191e29e15951283471966! ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss