These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problem with a given connection.
PostPosted: Thu Aug 12, 2004 9:09 am 
Newbie

Joined: Thu Aug 12, 2004 8:57 am
Posts: 2
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.