Jason Hildebrand wrote:
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
Jason,
i thank you for your reply, but this is as worst as i thought. No real Transactions in MiddleKit.
I'm using my homebrowed DBI-access with a ConnectionPool and real Transactions. I think i will use an ORM in the feature, but am still investigating.
Regards, Uwe
------------------------------------------------------- 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
