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: Refresh Nhibernate session based on Changes in Database?
PostPosted: Mon Aug 27, 2007 11:50 am 
Newbie

Joined: Mon Jul 16, 2007 9:35 am
Posts: 17
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 1.2

Mapping documents:

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

public void OpenSession()
{
if (_sessionCreatedLocally && (_session == null || !_session.IsOpen))
{
_session = PersistenceManager.NHFactory.OpenSession();
}

}

Full stack trace of any exception that occurs:

Name and version of the database you are using:

SQL Server 2005

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?
Read this: http://hibernate.org/42.html

Yes..

I am using LAZY = true in my HBM Mapping files, inorder to improve the performance of my WIN Application.
I face a scenario, where I want my session to be Refreshed or Reconnected based on any Changes in the Database.

Is there any way to capture the changes in Database ?
How to approach this.

Pass me your ideas.

Thanks in ADVANCE.
Cheers
Sudhagar.S


Top
 Profile  
 
 Post subject: Removed the static keyword
PostPosted: Tue Aug 28, 2007 8:53 am 
Newbie

Joined: Mon Jul 16, 2007 9:35 am
Posts: 17
I have used _session attribute as Static.

protected static ISession _session = null;

I removed the static keyword and executed.
It is working.

Thanks for your time.
Cheers
Sudhagar.S


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.