Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

current transaction is aborted, queries ignored until end of transaction block

 
hanihanan younis
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
urgently anyone know why this happened..
i have a servlet recieves more than 100 requests per second and when it go to Database side it gives that problem..
any professionals have angel solutions plz
BLESS ALL
[ October 12, 2005: Message edited by: Bear Bibeault ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hanihanan,
Can you reproduce the problem? Does it happen with 1 user? 2 users? Do you have a stack trace?
 
hanihanan younis
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it happens for more than 100 users of 2000 request
how can i avoid this problem plz
thank you for your caring
 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
First guess is that you are working with transaction in your code and that's creating a problem after the number of users are increased. Please check your transaction code and timeout period of the the transaction. Please keep a eye on how your database is responding when this problem occurs. Check for the locks at the database end.

Let me know.

Regards
Makarand Parab
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hanihanan,
I agree with Makarand. The only other place that may yield more information is the stack trace.
 
hanihanan younis
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Makarand and Jeanne
thi is the method that the exception apears in it:
public String checkIsUserSubscribe(Connection conn, String phoneStr, int pkgId)
throws SQLException, ClassNotFoundException
{
cat.debug("now we are in checkIsUserSubscribe method");
cat.debug("the phoneStr= "+phoneStr+", pkgId= "+pkgId);
//Connection conn = getConnection();
int upId = 0;
String upIdStr=null;
String call = "{? = call checkusersubscription(?,?)}";
CallableStatement cstmt = null;

try {
// conn.setTransactionIsolation(conn.TRANSACTION_SERIALIZABLE);
cat.debug("conn.getTransactionIsolation="+conn.getTransactionIsolation());
cstmt = conn.prepareCall(call);
//1 it means the first ? & so on..
//Types.BIGINT: the kind of it
cstmt.registerOutParameter(1, Types.VARCHAR);

cstmt.setString(2, phoneStr);

cstmt.setInt(3, pkgId);

cstmt.execute();
// upId = cstmt.getInt(1);
upIdStr=cstmt.getString(1);
// cstmt.close();
// conn.commit();
}
catch (Exception e) {
cat.error(e);
// SENDING THE EXCEPTION
try{
DispatcherSupport dispatcherSupport=new DispatcherSupport();
dispatcherSupport.sendURL(e+"");
}
catch(Exception except)
{
cat.debug("Exception in sending the exception"+except);
}
//END SENDING THE EXCEPTION

}
finally{
if (cstmt != null)
{
cstmt.close();
}

try {
//poolMng.freeConnection(poolName, conn);
} catch (Exception ee)
{
cat.error(ee);
// SENDING THE EXCEPTION
try{
DispatcherSupport dispatcherSupport=new DispatcherSupport();
dispatcherSupport.sendURL(ee+"");
}
catch(Exception except)
{
cat.debug("Exception in sending the exception"+except);
}
//END SENDING THE EXCEPTION

}

return upIdStr;
}

}

and the exception in log file appears like that:

DEBUG HandlerDAO -now we are in checkIsUserSubscribe method
DEBUG HandlerDAO - the phoneStr= 9656953235, pkgId= 270
ERROR HandlerDAO - java.sql.SQLException: ERROR: current transaction is aborted, queries ignored until end of transaction block

thanks
 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i don't see conn.rollback() anywhere in your code. Please put the same in the exception block and then give a try.

Regards
Makarand Parab
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic