dcsimg
How to lock a Oracle table using JDBC API ? Or any method?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abdul_Subahan
Posted On:   Thursday, June 7, 2001 08:21 PM

I have problem in locking an Oracle table. I 'm using : Connection con; try { con.setAutocommit(false); Statement st; st=con.createStatement(); st.execute("lock table emp in exclusive mode nowait"); // actually this statement locks the table successfully, but porblem is not releasing // I am issuing a commit and also handled the exception and rolling back // if everything is OK, do commit con.commit(); } catch (Exception e) { // some problem then rollback con.rollback(); con.setAutocommit(true); } ////////////|||\\\\\\ it excutes the co   More>>

I have problem in locking an Oracle table.

I 'm using :



Connection con;
try
{
con.setAutocommit(false);
Statement st;
st=con.createStatement();
st.execute("lock table emp in exclusive mode nowait");
// actually this statement locks the table successfully, but porblem is not releasing

// I am issuing a commit and also handled the exception and rolling back

// if everything is OK, do commit
con.commit();
}
catch (Exception e)
{
// some problem then rollback
con.rollback();
con.setAutocommit(true);
}




////////////|||\\\\\\

it excutes the commit statement successfully, but somehow not releasing the table to use again.

The command works fine in Oracle platform nicely.
Is there anyway to do this? Your help is much appreciated.

*** Subahan

   <<Less
About | Sitemap | Contact