Subject Re: [IBO] How do I post multiple datasets in a single transaction?
Author Helen Borrie
At 09:52 AM 25/09/2012, you wrote:
>Umm... you lost me. What are you talking about here? I haven't begun the transaction yet; all I've done is edited the data in the dataset.

If you have data in the dataset then you are in a transaction. You can't access data *at all* without a transaction. IBO creates a default one for you if you haven't specified one.

>And if that's what you mean, I can't set up the transaction first because there are multiple different editing operations which might require saving different groups of datasets together. Besides, if I did that, it would still require assigning a transaction to the dataset

That's not the way things work at all. See my previous message.
You can have multiple transactions per connection and multiple statements per transaction. What you can't have is statements hopping about between different transactions.

Do you understand transaction isolation at all?

Statements (specifically, SELECT statements) return result sets, which you are referring to as datasets. By default, transactions are read-write. As soon as you "post" the outcome of an edit (UPDATE), append (INSERT) or delete operation on the client side, the record concerned becomes locked to other transactions until your transaction is committed. How it is seen by other transactions after your transaction commits depends on the isolation level of those other transactions.

>, and having to close and reopen the datasets every time I change transactions is insane.

Why do you think it is insane? It is how a transactional database engine works. With IBO, you call Refresh when you want a fresh view of a dataset. That is, in fact, closing and reopening the dataset, though, and all the client-side structures are maintained.

>How do I fix that?

Do a bit of reading up about transactions? There are quite a few papers on the subject at http://www.ibobjects.com/TechInfo.html. Also check out the IBO help on the various data-access classes.

Helen