shl wrote:
Code:
public void updateMP(Mp mp) {
try {
Session session = HibernateSession.currentSession();
MpBO.updateMP(session, mp);
HibernateSession.closeSession();
}
catch(Exception e) {
System.out.println(">>> MP_EJB: Exception");
}
}
And look better for the string ">>> MP_EJB: Exception" in your logs :)
It would be more usable to log the exception :).
Or for testing replace it for System.out.println(">>> MP_EJB: Exception" + e.toString());
I know... :-)
Took out some lines to simplify reading.
I've looked at the debug info in "server.log".
Code:
2004-02-27 15:24:25,015 DEBUG [net.sf.hibernate.persister.EntityPersister] Updating entity: [vo.Mp#1]
2004-02-27 15:24:25,015 DEBUG [net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
2004-02-27 15:24:25,015 DEBUG [net.sf.hibernate.SQL] update mp set referencia=?, designacao=?, modelo=?, tipo=?, peso=?, fornecedor_fk=?, data_monitorizacao=?, desenho_material=?, norma=?, legislacao=?, fabricante=?, estado=?, estado_monit=?, user_id=?, dt_hr=? where id=?
2004-02-27 15:24:25,015 DEBUG [net.sf.hibernate.impl.BatcherImpl] preparing statement
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.persister.EntityPersister] Dehydrating entity: [vo.Mp#1]
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding 'REFMP' to parameter: 1
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding 'NOVAMP' to parameter: 2
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding 'TONECAS' to parameter: 3
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 4
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.BigDecimalType] binding '1.00' to parameter: 5
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 6
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.DateType] binding null to parameter: 7
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 8
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 9
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 10
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding '1' to parameter: 11
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding 'A' to parameter: 12
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding null to parameter: 13
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.StringType] binding 'dp1' to parameter: 14
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.TimestampType] binding '27 Fevereiro 2004 15:24:21' to parameter: 15
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.type.LongType] binding '1' to parameter: 16
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.BatcherImpl] Adding to batch
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.BatcherImpl] Executing batch size: 1
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.BatcherImpl] closing statement
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.SessionImpl] post flush
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.SessionImpl] closing session
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.SessionImpl] disconnecting session
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.engine.CacheSynchronization] transaction before completion callback
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.engine.CacheSynchronization] transaction after completion callback, status: 3
2004-02-27 15:24:25,031 DEBUG [net.sf.hibernate.impl.SessionImpl] transaction completion
( ... )
2004-02-27 15:24:51,359 DEBUG [net.sf.hibernate.impl.SessionImpl] running Session.finalize()
2004-02-27 15:24:51,359 DEBUG [net.sf.hibernate.impl.SessionImpl] running Session.finalize()
2004-02-27 15:24:51,359 DEBUG [net.sf.hibernate.impl.SessionImpl] running Session.finalize()
By the looks of it, the transaction is working. Need to test some "rollbacks".
What's strange is the lots of "Session.finalize()" that are executed.
Is this normal?