Subject Re: [Firebird-Java] Reserving multiple tables
Author Roman Rokytskyy
> Hi,

> I guess in this case I can do
>
> tpb.addArgument(TransactionParameterBuffer.PROTECTED);
> tpb.addArgument(TransactionParameterBuffer.LOCK_WRITE, "COUNTRY");
> tpb.addArgument(TransactionParameterBuffer.LOCK_WRITE,
> "EMPLOYEE");
>
> right?

No clue. It would correspond to

static char isc_tpb[] = {isc_tpb_version3,
isc_tpb_write,
isc_tpb_concurrency,
isc_tpb_nowait,
isc_tpb_protected, isc_tpb_lock_write, "COUNTRY",
isc_tpb_lock_write, "EMPLOYEE"};

which most likely is incorrect.

> But is it possible to do the equivalent of:
>
> static char isc_tpb[] = {isc_tpb_version3,
> isc_tpb_write,
> isc_tpb_concurrency,
> isc_tpb_nowait,
> isc_tpb_protected, isc_tpb_lock_write, "COUNTRY",
> isc_tpb_shared, isc_tpb_lock_write, "EMPLOYEE"};
>
> ie with different isc_tpb_protected / isc_tpb_shared?

Technically yes.

> Or doesn't that even make sense?

No clue... I would say - yes. One reserves shared locks, another -
protected.

But again, I do not know any site where it would be covered extensively...
So, if it is not in Helen's book, we have to write an article and publish it
on our wiki (and/or contribute to main site).

Roman

> btw, I don't need this at the moment - just interested!

> cheers,

> David
> x54680


|> ---------+----------------------------->
|>> dhay@... |
|>> Sent by: |
|>> Firebird-Java@yaho|
|>> ogroups.com |
|>>>
|>>>
|>> 01/31/2006 11:08 |
|>> AM |
|>> Please respond to |
|>> Firebird-Java |
|>>>
|> ---------+----------------------------->
>> ------------------------------------------------------------------------|
> |
> |
|> To: Firebird-Java@yahoogroups.com
|> | cc:
|> | Subject: [Firebird-Java] Reserving multiple tables
|> |
>> ------------------------------------------------------------------------|




> Hi Roman,

> I need to specify a write lock on multiple tables, and can't find the the
> correct syntax documented for Jaybird.

> In the IB docs, it has the following:

> static char isc_tpb[] = {isc_tpb_version3,
> isc_tpb_write,
> isc_tpb_concurrency,
> isc_tpb_nowait,
> isc_tpb_protected, isc_tpb_lock_read, "COUNTRY",
> isc_tpb_protected, isc_tpb_lock_write, "EMPLOYEE"};

> to lock 2 tables, one for read, one for write.

> But I need to effectively do the following:

> static char isc_tpb[] = {isc_tpb_version3,
> isc_tpb_write,
> isc_tpb_concurrency,
> isc_tpb_nowait,
> isc_tpb_protected, isc_tpb_lock_write, "COUNTRY",
> isc_tpb_protected, isc_tpb_lock_write, "EMPLOYEE"};

> How does this translate into creating the appropriate TPB?

> Do I do:

> tpb.addArgument(TransactionParameterBuffer.PROTECTED);
> tpb.addArgument(TransactionParameterBuffer.LOCK_WRITE,
> "COUNTRY");
> tpb.addArgument(TransactionParameterBuffer.PROTECTED);
> tpb.addArgument(TransactionParameterBuffer.LOCK_WRITE,
> "EMPLOYEE");

> or:

> tpb.addArgument(TransactionParameterBuffer.PROTECTED);
> tpb.addArgument(TransactionParameterBuffer.LOCK_WRITE, "COUNTRY,
> EMPLOYEE");

> It's hard to see with the former how they connect, so I'm guessing the
> latter?!!

> cheers,

> David




> Yahoo! Groups Links












> Yahoo! Groups Links