You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Lahiru Gunathilake <gl...@gmail.com> on 2011/07/15 22:40:58 UTC
How to unlock a table in derby
Hi Devs,
I am using derby as embedded database in my system and I want to lock a
table for that I execute query "lock table <table name> in share mode" but I
cannot see any documentation on how to unlock a derby table.
Please provide some information on how to handle a scenario like this with
embedded derby.
Thanks in advance
Lahiru
Re: How to unlock a table in derby
Posted by Bryan Pendleton <bp...@gmail.com>.
On 07/18/2011 07:16 AM, Lahiru Gunathilake wrote:
> Hi Byan,
>
> I am creating the connection with autoCommit=true parameter, does this work with derby or should I explicitly commit the
> transaction?
>
>
> Lahiru
I believe if you do this, the system will automatically insert a 'commit'
immediately after your 'lock table' statement, thus releasing the lock
immediately and making the lock not very useful.
When I use 'lock table', I always do it with autocommit=false.
thanks,
bryan
Re: How to unlock a table in derby
Posted by Lahiru Gunathilake <gl...@gmail.com>.
Hi Byan,
I am creating the connection with autoCommit=true parameter, does this work
with derby or should I explicitly commit the transaction?
Lahiru
On Mon, Jul 18, 2011 at 9:58 AM, Peter OndruĹĄka <
peter.ondruska+derby@kaibo.eu> wrote:
> Rollback might work as well :)
> Dne 18.7.2011 15:57 "Lahiru Gunathilake" <gl...@gmail.com> napsal(a):
>
> > I will try it, thank you Byan !
> >
> > Lahiru
> >
> > On Fri, Jul 15, 2011 at 8:47 PM, Bryan Pendleton <
> bpendleton.derby@gmail.com
> >> wrote:
> >
> >> I execute query "lock table <table name>
> >>> in share mode" but I cannot see any documentation on how to unlock a
> derby
> >>> table.
> >>>
> >>
> >> Commit.
> >>
> >> thanks,
> >>
> >> bryan
> >>
> >>
>
Re: How to unlock a table in derby
Posted by Peter Ondruška <pe...@kaibo.eu>.
Rollback might work as well :)
Dne 18.7.2011 15:57 "Lahiru Gunathilake" <gl...@gmail.com> napsal(a):
> I will try it, thank you Byan !
>
> Lahiru
>
> On Fri, Jul 15, 2011 at 8:47 PM, Bryan Pendleton <
bpendleton.derby@gmail.com
>> wrote:
>
>> I execute query "lock table <table name>
>>> in share mode" but I cannot see any documentation on how to unlock a
derby
>>> table.
>>>
>>
>> Commit.
>>
>> thanks,
>>
>> bryan
>>
>>
Re: How to unlock a table in derby
Posted by Lahiru Gunathilake <gl...@gmail.com>.
I will try it, thank you Byan !
Lahiru
On Fri, Jul 15, 2011 at 8:47 PM, Bryan Pendleton <bpendleton.derby@gmail.com
> wrote:
> I execute query "lock table <table name>
>> in share mode" but I cannot see any documentation on how to unlock a derby
>> table.
>>
>
> Commit.
>
> thanks,
>
> bryan
>
>
Re: How to unlock a table in derby
Posted by Bryan Pendleton <bp...@gmail.com>.
> I execute query "lock table <table name>
> in share mode" but I cannot see any documentation on how to unlock a derby table.
Commit.
thanks,
bryan