Subject | Re: [IBO] Transaction Control |
---|---|
Author | Jason Wharton |
Post date | 2003-11-17T21:02:40Z |
In IBO you can cleanly distinguish betwee three transaction aspects. They
are physical, logical and explicit. IBX forces you to to work with them all
mangled together as one.
The physical aspect is whether or not you have a transaction handle
allocated at the client. You query this using the Started property.
The logical aspect is whether or not the transaction has any pending updates
to be committed or not.
The explicit aspect is what you as a programmer are able to do with the
StartTransaction method and you query this using the InTransaction property.
There are a lot more details about this in the documentation.
Why treat them separately? Well, its very useful to do so. If you call
StartTransaction and then the user does this and that and clicks on a form
close button you can check to see if they actually have edits pending a
commit. If they have none, just close the form. If they do, then prompt them
if they want to Commit, Rollback or Cancel. Also, if you call
StartTransaction to denote you want the users work done in a transaction,
yet they don't do anything to require the presence of a physical handle
brought to the client, then IBO won't get one until it is needed. Also, IBO
watches carefully and allows physcial handles to be recycled as needed.
These features are almost invisible but go a long way to help your
application be much more efficient with server resources, while at the same
time giving you more functionality and control in your application.
HTH,
Jason Wharton
are physical, logical and explicit. IBX forces you to to work with them all
mangled together as one.
The physical aspect is whether or not you have a transaction handle
allocated at the client. You query this using the Started property.
The logical aspect is whether or not the transaction has any pending updates
to be committed or not.
The explicit aspect is what you as a programmer are able to do with the
StartTransaction method and you query this using the InTransaction property.
There are a lot more details about this in the documentation.
Why treat them separately? Well, its very useful to do so. If you call
StartTransaction and then the user does this and that and clicks on a form
close button you can check to see if they actually have edits pending a
commit. If they have none, just close the form. If they do, then prompt them
if they want to Commit, Rollback or Cancel. Also, if you call
StartTransaction to denote you want the users work done in a transaction,
yet they don't do anything to require the presence of a physical handle
brought to the client, then IBO won't get one until it is needed. Also, IBO
watches carefully and allows physcial handles to be recycled as needed.
These features are almost invisible but go a long way to help your
application be much more efficient with server resources, while at the same
time giving you more functionality and control in your application.
HTH,
Jason Wharton