|Subject||Re: [IBO] Lookup Refresh (was Lookup problem)|
> I asked once before whether I needed two datasets (henceWhat do you mean "hence transactions" ???
A transaction encapsulates a unit of work, and this often involves
multiple datasets - where you want all changes and data visibility
to be consistent across the datasets.
For example; In a master/detail setup you have (at least) two
datasets. In this configuration both datasets should be attached
to the same transaction.
Lookups can get rather more complicated depending on exactly what
you want to achieve. Probably the most common situation that people
implement (rightly or wrongly) is to have the lookup attached to
the same Transaction as the dataset that needs the lookup.
In this instance, any separate form (with a separate dataset for
adding a new lookup record) will probably have a different
transaction. After adding AND committing the new lookup record
using a different dataset and transaction - it will be necessary
to refresh the lookup dataset attached to the other transaction.
Now this is where you can be tricked! Maked sure the other
transaction has an Isolation of ReadCommitted. If that transaction
is still on Concurrency (the default) then it will not see the
new lookup record even when you refresh the lookup dataset. It will
not be able to see the new record until its own separate transaction
is completely restarted.