-->
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: More information about replication?
PostPosted: Mon Aug 25, 2008 7:44 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
Hi,

is there any more infomation about the hibernate replication process?

I need information like:

Does it work like normal "Merge Replication"?
Does it use unique ids?
Does it work with timestamps or other methods?
...

I look for a white paper or a documentation with more details.

Thans in advanced! Origon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 26, 2008 6:41 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
[b]Nobody[/b] knows where i can find or look for more information?

It have to exist any paper with information about this process?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 26, 2008 6:58 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Maybe you could explain what you mean by "the hibernate replication process"

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2008 2:15 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
I hope replication is known. If not look here:
http://en.wikipedia.org/wiki/Database_replication#Database_replication

Please look in this Hibernate chapter and you know what I mean.
Hibernate source:
http://www.hibernate.org/hib_docs/reference/en/html/objectstate.html#objectstate-replicating

code snippet:

Code:
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();

session.replicate(obj, ReplicationMode.OVERWRITE);

session.getTransaction().commit();


I want know how does it work internal.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2008 6:08 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Cool didn't know that method existed.

Although the method and the wikipedia article don't go well together. I think database replication normally refers to some kind of automatic process, while Hibernate just allows to replicate one object(-graph) on demand. That is really why I was so confused.

If I got it right your question is how hibernate will behavee when the target store already has a version of the object to be replicated?

I think the answer is right there in the piece of documentation you referenced:

Quote:
The ReplicationMode determines how replicate() will deal with conflicts with existing rows in the database.

*

ReplicationMode.IGNORE - ignore the object when there is an existing database row with the same identifier
*

ReplicationMode.OVERWRITE - overwrite any existing database row with the same identifier
*

ReplicationMode.EXCEPTION - throw an exception if there is an existing database row with the same identifier
*

ReplicationMode.LATEST_VERSION - overwrite the row if its version number is earlier than the version number of the object, or ignore the object otherwise


To determine which version is the latest I'd assume that the version attribute defined by the hibernate mapping is used.

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2008 7:42 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
schauder wrote:
If I got it right your question is how Hibernate will behavee when the target store already has a version of the object to be replicated?

Unfortunately not. :)

This options at the hibernate documentation are responsible to solve replication conflict. But I need more information how Hibernate know which objects are changed since the last round of replication.
How Hibernate keeps track of the identity of objects.
What is the version exactly? An timestampt?

I need information because I want discripe the replication process from Hibernate accurate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2008 7:49 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
[quote="Origon"][quote="schauder"]
If I got it right your question is how Hibernate will behavee when the target store already has a version of the object to be replicated?
[/quote]
Unfortunately not. :)

This options at the hibernate documentation are responsible to solve replication conflict. But I need more information how Hibernate know which objects are changed since the last round of replication.
How Hibernate keeps track of the identity of objects.
What is the version exactly? An timestampt?
Use Hibernate database specific(or dependent) methods?

I need information because I want discripe the replication process from Hibernate accurate.[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 27, 2008 2:49 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Origon wrote:
But I need more information how Hibernate know which objects are changed since the last round of replication.
How Hibernate keeps track of the identity of objects.

I said it before: Hibernate doesn't. It doesn't do 'rounds of replication', nor has it a 'replication process' It just gives you a handy method to store a copy of an object graph you pulled out of the database (using hibernate), in a different database.

Origon wrote:
What is the version exactly? An timestampt?

Have a look here:
http://www.hibernate.org/hib_docs/core/ ... on-version

If you want more information along that line check out "Hibernate in Action"

regards
Jens

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2008 1:35 am 
Newbie

Joined: Mon Aug 25, 2008 6:49 am
Posts: 6
schauder wrote:
It doesn't do 'rounds of replication', nor has it a 'replication process' It just gives you a handy method to store a copy of an object graph you pulled out of the database (using hibernate), in a different database.


Ok, I thought that it is better as a round of replication because I can choose which objects schould be replicat.

Thanks for your effort, your argument was very helpful for me.

Origon


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.