[SQLObject] ? Treadsafety, transactions, DB-API ?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Bud P. B. <bu...@si...> - 2003-06-11 17:39:38
|
Can someone help me calm my mental storm stemming from a confusion and lack of understanding on treadsafety, transactions, and DB-API? For SQLObject to be threadsafe, do threads need an isolation of their transactions? It seems so, since one thread will typically want to commit while another one is in the middle of its transaction... But then again, if multiple threads modify the same objects (in memory), does isolation of transactions really guarantee consistency? It seems that this could only be true if there were locks on application objects. For example, a multi-threaded app that transfers funds between instances of Account would probalby have to lock (or version) affected Account instances for the duration of a transaction such that no other thread can debit or accredit funds and mess up consistency. Does SQLObject do something of this sort or has my reasoning gone astray somewhere? Also, in my (probably faulty) understanding of the DB-API, transactions are properties of connections. Does that mean that different threads need to use different connections? Does SQLObject do that? many thanks for any clarifications --b /----------------------------------------------------------------- | Bud P. Bruegger, Ph.D. | Sistema (www.sistema.it) | Via U. Bassi, 54 | 58100 Grosseto, Italy | +39-0564-411682 (voice and fax) \----------------------------------------------------------------- |