Reputation: 36713
I'm calling a mysql stored procedure from Java like this:
public void deleteMyProduct(final String country, final String someId) throws EntityDoesNotExistException {
getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(final Session session) {
session.clear();
Connection con = session.connection();
try {
CallableStatement cst = con.prepareCall("{call deleteProduct( ?, ? )}");
cst.setString(1 , country);
cst.setString(2 , someId);
cst.execute();
cst.close();
}
catch(SQLException e){
logger.error("Error deleting product, someId: "+ someId, e);
}
return null;
}
});
It's not successfully deleting the product; however when I run it manually, it does. Any idea what the problem could be?
p.s. the stored procedure is pretty large and contains identifiable info, so I'm not at liberty to post it. However, it's been in production for a while and only recently just stopped working.
Upvotes: 0
Views: 191
Reputation: 181
country
and someId
actually correct?SQLException
say?Connection con = session.connection();
?Int
instead of String
)?Upvotes: 1