wood burning stoves 2.0*
The moose likes JDBC and the fly likes current transaction is aborted, queries ignored until end of transaction block Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "current transaction is aborted, queries ignored until end of transaction block" Watch "current transaction is aborted, queries ignored until end of transaction block" New topic
Author

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

hanihanan younis
Ranch Hand

Joined: Jul 06, 2005
Posts: 36
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

Hanihanan,
Can you reproduce the problem? Does it happen with 1 user? 2 users? Do you have a stack trace?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
hanihanan younis
Ranch Hand

Joined: Jul 06, 2005
Posts: 36
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

Joined: Dec 10, 2004
Posts: 121
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

Hanihanan,
I agree with Makarand. The only other place that may yield more information is the stack trace.
hanihanan younis
Ranch Hand

Joined: Jul 06, 2005
Posts: 36
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

Joined: Dec 10, 2004
Posts: 121
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: current transaction is aborted, queries ignored until end of transaction block
 
Similar Threads
InitialContext did not implement EventContext
questions?
Not able to add values in a database
Transaction through EJB3
Transaction propagation in EJB