-->
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.  [ 4 posts ] 
Author Message
 Post subject: SessionFactory
PostPosted: Thu Mar 18, 2004 2:15 pm 
Newbie

Joined: Mon Jan 12, 2004 11:59 am
Posts: 13
Location: USA
Hi:

I am using Hibernate version 2.1 and Oracle 9i.

Problem 1: I initialize the configuration and create SessionFactory the following way:

Code:
cfg = new Configuration().addFile("C:/Test/Hibernate.xml")
     .setProperties(properties);

sessionFactory = cfg.buildSessionFactory();


Everything works great. But when the system output is showing the following info it takes way too much time.

10:56:30,624 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended).

Problem 2: When I just flush the session or even close the session the data does not get stored in the database and it does get stored only when I close the session factory.

Code:
Session session = sessionFactory.openSession();
session.save(dataObject);

session.flush();   
session.close();
sessionFactory.close();


Shouldn't the data get stored after I flush?

Thank you in advance,
Om


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 18, 2004 2:46 pm 
Newbie

Joined: Wed Feb 18, 2004 6:50 am
Posts: 6
Hi!

About your first problem I did'n said nothing, sorry. But, about the second problem I can help you. Try this code:

session.flush();
session.connection().commit();
session.close();


Att
Marcos Gorll
[/i]

_________________
"If brute force don't resolve your problems... you aren't using enought"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 18, 2004 4:13 pm 
Newbie

Joined: Mon Jan 12, 2004 11:59 am
Posts: 13
Location: USA
Thanks Marcos, it works!
Appreciate it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 18, 2004 5:23 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
and don't forget to take a look at transaction... there are many examples in the doc and it's sure you'll need it soon


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

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.