-->
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.  [ 9 posts ] 
Author Message
 Post subject: data lost when jboss shutdown
PostPosted: Fri Sep 10, 2004 1:40 am 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
Hibernate version:
2.1.6

db:
hyper sonic

hi all
using SLSB to insert new USER to db,
using: CMT ,

ending session with :
session.saveOrUpdate(user)
session.close();

data is stored just fine when application ends
but when jboss restart data is lost....


Top
 Profile  
 
 Post subject: Re: data lost when jboss shutdown
PostPosted: Fri Sep 10, 2004 6:12 am 
Beginner
Beginner

Joined: Mon Aug 16, 2004 6:09 am
Posts: 46
Location: Geneva, Switzerland
nomga wrote:
Hibernate version:
2.1.6

db:
hyper sonic

hi all
using SLSB to insert new USER to db,
using: CMT ,

ending session with :
session.saveOrUpdate(user)
session.close();

data is stored just fine when application ends
but when jboss restart data is lost....


Can you clarify? You shutdown jboss and see you data persisted in dbms.
But after restart what's in db? old data? is there any activity in between?

Check everything twice, looks incredible...

btw - what do you mean "application ends"? Make sure you see new data in dbms after transaction commited.


Top
 Profile  
 
 Post subject: ok...
PostPosted: Fri Sep 10, 2004 12:01 pm 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
first of all thank you very much for your replay
here is the deal ..

jbossRC2+hibernate-2.1.6+hypersonic

i took the eg..../auction example hbm.xml's and classes ,
added a hibernate-xml , ejb interceptors(in standardjboss)

and deployed it in a .HAR like:

----->meta-inf/hibernate-service.xml

-->org
--->hibernate
------->auction
-------->example's hbm's and classes

(by the way didnt specify in hiber'-svc.xml the resources jboss found it in deployment)

deployed the har, the mbean was created -
db tables also created.

used a SLSB, to get the session factory from jndi with initial context.


used a simple console client to get the SLSB ,
in SLSB:

User user = new User();
user.set some stuff......
session.saveOrUpdate(user);
session.close()

after the client finshed i could see in the db console the new values in the user table(though id was 0 );

after jboss was restarted (.har was undeployed and redeployed)
the user table was empty......

i know i should have called the flush() but the data was written so i dont think it got anything to do with it

thank u very very much


Top
 Profile  
 
 Post subject: forgot something
PostPosted: Fri Sep 10, 2004 12:14 pm 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
but....could it be that because i didnt flush()
when jboss restarted the txn was rolledback?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2004 1:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
but....could it be that because i didnt flush()
when jboss restarted the txn was rolledback?

Not if you saw it in another process (i.e., the db console).

Probably you have SchemaExport set to run on SessionFactory startup/shutdown. Thats the normal reason for seeing this type of behaviour. Check your logs to see if drop table commands were being executed and the schema recreated on startup.

Quote:
(by the way didnt specify in hiber'-svc.xml the resources jboss found it in deployment)

Of course. Thats the whole point of the har deployer. :)


Top
 Profile  
 
 Post subject: re`
PostPosted: Fri Sep 10, 2004 1:28 pm 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
you mean :
hibernate.hbm2ddl.auto ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2004 1:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Yes, though its called Hbm2ddlAuto on the MBean


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 10, 2004 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
If you are using my test stuff, it sets this value to create-drop. Probably not what you want for anything other than a unit test env :)


Top
 Profile  
 
 Post subject: thnx
PostPosted: Fri Sep 10, 2004 1:42 pm 
Newbie

Joined: Thu Sep 09, 2004 4:49 am
Posts: 10
thanx ......

by the way i wish that every LGPL group will as supporting as u guys .....
Code:
<@>          <@>
     
             ||
      \_______/


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