-->
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: Problems moving Hibernate code from one server to another!
PostPosted: Thu Oct 19, 2006 8:09 am 
Newbie

Joined: Thu Oct 19, 2006 7:31 am
Posts: 1
Hi,
I'm developing an application with Eclipse (plugin MyEclpise) where I use Hibernate3 to handle database transactions to MySQL.

But something confuses me!

The application works fine on my develop machine (Window XP, Hibernate3, MySQL 5.0.18-nt, tomcat 5.5.15) but not on my internetserver (Linux, Hibernate3, MySQL 4.1.21-log, tomcat 5.5.20)

Code between sessionFactory.openSession() and session.close():

Example of code that does NOT work on internetserver:

Example 1)
public void save(FreeKeys transientInstance) throws RuntimeException {
Session s = openSession();
Transaction tx = s.beginTransaction();
s.saveOrUpdate(transientInstance);
tx.commit();
tx = null;
closeSession(s);
}

Example 2)
public FreeKeys findById(Long id) {
Session s = openSession();
Transaction tx = s.beginTransaction();
try {
FreeKeys instance = (FreeKeys) s.get("FreeKeys", id);
tx.commit();
return instance;
} catch (RuntimeException re)
...

Example of code that DO work on internetserver:

Session s = openSession();
Transaction tx = s.beginTransaction();
try {
List results = (Criteria) findMoreByExample(s, instance).list();
tx.commit();
return results;
} catch (RuntimeException re)
...

Seems like all queries with Criteria work on both machines!

Can anybody help me! What am I doing wrong?

Thanx in advance!

/Samuel


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.