Hibernate version: 2.1
Mapping documents: Clients.hbm
Code between sessionFactory.openSession() and session.close():
Configuration cfg = new Configuration();
cfg.addFile("Clients.hbm");
SessionFactory factory = cfg.buildSessionFactory();
Session session = factory.openSession(connection);
client.setCliName("client 1");
client.setIdRight(new Integer(1));
clientsDAO.save(client, session);
clientsDAO.findAll(session);
session.close();
Full stack trace of any exception that occurs:
no error
Name and version of the database you are using:
mySql 4.0.18
Debug level Hibernate log excerpt:
--> problem
i am experiencing some problems when i try to provide my own connection. In fact i need to do that because i am using MBeans, and i want to control all. So the problem is that when i do clientsDAO.save() without the findAll(), nothing is added to the DB, but with findAll() the client is registered in the DB. I have tried everything with closing the sesion by different ways, commiting and closing the connection, but nothing could help. Am i doing something wrong ??
I need that because i do have a JNDI object that is a XADataSource, and i want to use its connection so that way it can participate in an XA transaction. of course i do not want to use EJB, and to let it manage my connections.
thank you.
Daniel
|