Subject | Re: Exclusive Lock |
---|---|
Author | nitaligavino |
Post date | 2002-10-01T14:58:10Z |
--- In ib-support@y..., "Dimitry Sibiryakov" <SD@t...> wrote:
table lock during transaction creation. Here is an example of how to
setup the char vector: (C / C++)
static char trans_locked[] =
{
/**Interbase version.*/
isc_tpb_version3,
/**Access mode.*/
isc_tpb_write,
/**Isolation level.*/
isc_tpb_concurrency,
/**Lock resolution.*/
isc_tpb_nowait,
/**Table reservation.*/
isc_tpb_lock_write,
`T',
`a',
`b',
`l',
`e',
isc_tpb_protected, // End table
/**Terminator.*/
'\0',
};
Here a tpb is created for an exclusive write lock on the table
named "Table".
After building up this tpb you can then pass it to:
isc_start_transaction( )
Note that the size is:
int iSize = sizeof(trans_locked) 1);
We don't consider the terminator.
I hope this is still accurate, it's been about a year since I looked
at this!
You can also look at the API Guide under the section:
"Specifying table reservation"
However, if I remember correctly the examples in the documentation
don't seem to work correctly.
Hope this helps.
Dan
> On 30 Sep 2002 at 19:32, Guillermo Najar-Arreola wrote:for
>
> >multiuser acces. How can I achieve this exlusive-lock in Firebird
> >a table? I'd like not doing it from my application using flags thattpb_exclusive,
>
> You can play with transaction's parameters (such as
> tpb_lock_read, tpb_lock_write). But don't ask me - how. I don'tknow.
>If you are using the API calls then you can acquire an exclusive
> SY, Dimitry Sibiryakov.
table lock during transaction creation. Here is an example of how to
setup the char vector: (C / C++)
static char trans_locked[] =
{
/**Interbase version.*/
isc_tpb_version3,
/**Access mode.*/
isc_tpb_write,
/**Isolation level.*/
isc_tpb_concurrency,
/**Lock resolution.*/
isc_tpb_nowait,
/**Table reservation.*/
isc_tpb_lock_write,
`T',
`a',
`b',
`l',
`e',
isc_tpb_protected, // End table
/**Terminator.*/
'\0',
};
Here a tpb is created for an exclusive write lock on the table
named "Table".
After building up this tpb you can then pass it to:
isc_start_transaction( )
Note that the size is:
int iSize = sizeof(trans_locked) 1);
We don't consider the terminator.
I hope this is still accurate, it's been about a year since I looked
at this!
You can also look at the API Guide under the section:
"Specifying table reservation"
However, if I remember correctly the examples in the documentation
don't seem to work correctly.
Hope this helps.
Dan