-->
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: Winform <-> WebService <-> Hibernate
PostPosted: Mon Oct 17, 2005 5:01 am 
Newbie

Joined: Mon Oct 17, 2005 4:52 am
Posts: 1
Hi all

Being a totally newbie to Hibernate on the .NET platform I have a question about the above scenario.

I have a client (winform)
I have some webservices
I have a data access layer serverside (based on Hibernate)

So when I invoke a webmethod to get a list of all customers, hibernate fetches those and streams them right back to the client through the web service.
Then I edit a given customer, eg changes the name, and calls another webmethod, eg UpdateCustomer.
How does hibernate track changes?
Does it store the complete object, or does it somehow know, what properties, references, composites have been changed and needs updating/creating?

Are there any best practices using this scenario? It differs from the scenario from the previous posts (regarding sessions) in that there's a WS layer between hibernate and the client.
I don't need to care about hibernate in my client (winform), right? as the client always invokes webmethods, right?

Thanx in advance for your feedback.

Regards

Henrik


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 8:31 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
NHibernate has two caches:
a Session-level cache (1st level) and a SessionFactory-level cache (2nd level). (cf. NHibernate.Caches)
These caches are used to track changes (among other things).

In your case, you will probably use two different sessions to load and save your customer. It means that only the 2nd level cache can give NHibernate the information it needs to find the changes.

By default, update commands are compiled when creating the SessionFactory; it means that when you save an entity all its properties are sent to the database.
You can enable "dynamic-update" to ask NHibernate to create a specific update command for each case (and with only the changed properties).

Finally, as you said, your client should not be aware of NHibernate (and even the persistence strategy)... Anyway, it depends of your requirements.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.