-->
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.  [ 3 posts ] 
Author Message
 Post subject: Having problems with writes
PostPosted: Mon Jun 07, 2004 11:15 am 
Beginner
Beginner

Joined: Sat Mar 13, 2004 4:00 pm
Posts: 32
Hi,

I have a Session Bean running inside a JBoss controlled transaction that is trying to insert an newly built persisted object using the following code:

Context context = new InitialContext();
SessionFactory sessionFactory (SessionFactory)context.lookup("java:/hibernate/myDS");
Session session = sessionFactory.openSession();

Object object = session.saveOrUpdateCopy(obj);
session.close();

Now if I understand the documentation correcly, JBoss is in control of commiting the transaction I 'm not required to do a flush or a commit. However, the data never gets actually written to the database. What am I missing?

I'm using Hibernate 2.1.2 and JBoss 3.2.4, using JBossCache (not ehache).

Thanks in advance,

Rich


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 07, 2004 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You must flush manually if you are not using the Transaction API


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 07, 2004 12:12 pm 
Beginner
Beginner

Joined: Sat Mar 13, 2004 4:00 pm
Posts: 32
Michael,

Thanks for responding. I did mis-read the docs. I was getting a very strange error I thought
was related to the session.flush(). But it turns out it was a JBossCache error being thrown
when the SessionBean was commiting the transaction. I believe the JBossCache error was because I defined the cache strategy as "read-write" instead of "transactional".

Thanks again,

Rich


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.