On Thu, 4 May 2006, Ash Grove wrote:

> Hi,
>
> Does beginning a transaction put locks on the tables
> queried within the transaction?
>
> In the example below, is #2 necessary? My thought was
> that I would need to use an explicit lock to make sure
> that the sequence value I'm selecting in #4 is the
> same one that is generated from #3. I'm worried about
> another instance of the application doing an insert on
> table1 between #3 and #4.

If you have 1 session per instance and #3 and #4 are done after each
other without any intervening commands, the behavior of nextval/currval
should guarantee that (currval gives the value from this session's
nextval, not any other).


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to