Olá, estou tomando o seguinte erro: java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction.
Gostaria de saber se alguém poderia me dar um HELP. Obrigado desde já.
Segue abaixo o código:
public void save(final Cliente cliente) throws SQLException {
Session session = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
Connection conn = session.connection();
PreparedStatement stmt = null;
String sql = null;
try {
sql = "INSERT INTO clientes_tb( " +
"cliente_id, nome) " +
" VALUES(?,?)";
stmt = conn.prepareStatement(sql);
stmt.setString(1, cliente.getCliente_id());
stmt.setString(2, cliente.getNome());
stmt.executeUpdate();
}finally {
conn.close();
stmt.close();
}
}