Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Pool and shareable connection error (WSAD 5.0 & SQL Server)

  Asked By: Nicole    Date: Jun 30    Category: Java    Views: 1027
  

process 1 is completed and committed successfully
but when process 2 starts, in method1
int count = st.executeUpdate();
line causes a deadlock connection error.
First 2-3 munites suspending and then force to stop server....
Can anybody help????

my code :

try {
conn = xxx.Util.getConnection();
// gets conn from javax.sql.DataSource (Pool)
conn.setAutoCommit( false );

//process 1 start
boolean condition1= method1(conn, a,b,etc); //update
boolean condition2= method2(conn, a,b,etc); //insert
boolean condition3= method3(conn, a,b,etc); //update
if ( condition1 && condition2 && condition3) {
conn.commit();
} else {
conn.rollback();
}
//process 1 finish

//process 2 start
condition1= method1(conn, a,b,etc); //update
condition2= method2(conn, a,b,etc); //insert
condition3= method3(conn, a,b,etc); //update
if ( condition1 && condition2 && condition3) {
conn.commit();
} else {
conn.rollback();
}
//process 2 finish

} catch (Exception e) {
//....
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 




Tagged: