🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17242

Placing a shared lock while insert/ delete /update

#17242
From: Sankar
Date: Mon, 07 Dec 1998 00:00
26 lines
1250 bytes
Hello friends ,

    Please help me to solve this problem ...

I have a method in which I have two or three insert or delete or update
statements. I want to rollback to the starting of the method if anything
goes wrong or any of these statements fail.

I tried using db.setautocommitt(false) at the beginning of the method
and

db.committ; and
db.setautocommitt(true) at the end of the method

and

db.rollback; and
db.setautocommitt(true) in case of any exception.

But, this happens to place an exclusive lock on the table we are
accessing and we are not able to access any of the rows in that table.
Is there a way of placing a shared lock? If so what should be specified?

Thanks in Advance,

Sankar S.
Technical Details
Message-ID: <74gof8$79a23@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,bb7718c8b1b13393,start
X-Google-Attributes: gidf74b3,public
From: "Sankar" <sunducs@usa.net>
Subject: Placing a shared lock while insert/ delete /update
Date: 1998/12/07
Message-ID: <74gof8$79a23@forums.borland.com>
X-Deja-AN: 419637445
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: Another Netscape Collabra Server User
Reply-To: "Sankar" <usubsa01@shafika.vetri.com>
Newsgroups: borland.public.jbuilder.java.language