-->
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.  [ 2 posts ] 
Author Message
 Post subject: Objects are not saving to database
PostPosted: Thu Jan 24, 2008 1:41 pm 
Newbie

Joined: Tue Jun 05, 2007 5:17 pm
Posts: 3
Hi,

I have a problem that objects are not saving in database.

Environment:

Hibernate verion 2.0
DB: SQL Server 2000
JDK: 1.5
App.Server: Orion 2.0.5

Here is the problem:

There are two databases having same tables and its structure.
Assume those dbs are like db1 and db2. There also two hibernate properties of each db. Our application read and write to db1 but it only reads from db2.

sessionfactoru is built at the time of app.server startup. Initially this sessionfactory is associated with the properties of db1.

Whenever user1 needs to read from db2, application detects it based on some boolean value and it assigns the new properties of db2 to the existing sessionfactory then create and return different persistent instance (assume that there are two persistent instances associated with same sessionfactory but having different properties)

Now at this moment, some other user performing any write operation on DB1, Objects are not saving to db2.

I know this is very difficult to understand. For me It took some days to understand fully. I have recenly joined in this project and I am assigned to this problem. Still now I didn't understand what factor forced them to design this projet in such way when they start it.

Anyways, is there any soluction for this? or is this the right way to do this?

Any kind of help greatly appreciated. Pls don't hesitate to ask any question or need more details or code...etc.

It would be really great if we communicate by mail (but not necessary).

my mail id : rakesh.munger@gmail.com

Thank you somuch of your patience shown in read of the entire description.

-Rakesh


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 24, 2008 2:11 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
rakesh,

For things to be persisted in the database, your operations have to be wrapped in a transaction, and bound to a valid session. Assuming you have the session problem resolved, how are you managing to wrap operations from two databases into the transaction?

You would need to provide more information, such as your mapping files, your database structure, your classes and some client code.

_________________
Gonzalo Díaz


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