Cool, sounds good now I need to test it!

Ed Leafe wrote:
> These changes are designed to work within the entire framework; i.e., 
> applications, forms, bizobjs and cursors. If you use any single piece of the 
> framework separately, such as a raw cursor, you will have to manage 
> transactions yourself.
And by managing transactions yourself, do you mean like:
crs.new()
crs.Record.cname = "Paul"
crs.new()
crs.Record.cname = "Ed"
crs.beginTransaction()
crs.save(allRows=True)
crs.commitTransaction()


> Transactions now happen happen by default when calling biz.save()/saveAll() 
> and biz.delete()/deleteAll(). If for some reason you do not want 
> transactions, you must call them with the parameter startTransaction=False.
Do we need provisions for this at the UI level... e.g. in dForm.save() 
and dForm.delete()?


> Only one bizobj will begin and commit/rollback. All others do not touch 
> transactions, as they are within the current transaction. Upon a save or 
> delete method being called, the bizobj will request the transaction 'token' 
> from the app. If no other bizobj has started a transaction, it will have True 
> returned from the request, and the bizobj will handle the transaction. If 
> there are related bizobjs who in turn have their save/delete methods called, 
> their requests for the token will be denied, so they will not do anything 
> regarding transactions. When the process is completed in the initial method 
> that requested the token, either a commit or rollback will be called, and the 
> token released.
I think maybe this would have been better if it were at the connection 
level instead of the app level. IOW, I could have 2 connections to one 
db server and a connection to another db server, and an additional 
connection to a local sqlite database. Transactions for each of these 
connections should be isolated from each other, no?


> This design eliminates the problem with nested and chained bizobjs starting 
> and/or ending multiple transactions. Only the original bizobj in the process 
> can manage transactions, and only from the method that was originally called.
Yes, it should let an app developer:

biz.new()
biz.new()
biz.saveAll()

...resulting in:
begin
insert
insert
commit



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to