|
From: Steve E. <ste...@jb...> - 2006-08-09 11:28:53
|
Not sure if anyone replied to this yet or not, so I'll throw my $0.02
into the discussion. I think all that is needed is to better allow
definition of what is to occur during replication in the method call.
For example, consider the changing the signature from accepting a
ReplicationMode to accepting a (new) "ReplicationStrategy", where
ReplicationStrategy is defined something like:
ReplicationStrategy {
/**
* How should we react when we encounter a pre-existing row
* in the target database?
* <p/>
* TODO: probably rename the ReplicationMode class to MergeMode
*/
public ReplicationMode getMergeMode() ...=20
/**
* When replicating an entity which does not yet occur in the
* target database, should we enforce that the target data
* we are about to create have the same identifier value?
*/
public boolean forceIdentiferRetention() ...
}
Also, there has been some discussion about moving the replicate
functionality from the Session interface to the StatelessSession
interface which would be a good point in time to introduce such changes.
-----Original Message-----
From: hib...@li...
[mailto:hib...@li...] On Behalf Of
Darryl Miles
Sent: Tuesday, August 01, 2006 12:47 PM
To: hib...@li...
Subject: [Hibernate] Session.replicate() into IDENTITY table ?
A while ago I highlighted a problem with the differences between the=20
documented API and what Hibernate actually does and I'm seeking to an=20
open discussion about the merits and problems to renaming the current=20
#replicate() function to #replicateOrSave() to better identify what it=20
actually does.
This is so that a hole can be left open to implement a real #replicate()
function which makes contact guarantees that the primary key / OID will=20
be identical even in IDENTITY tables in the replicated object or=20
otherwise it throws an exception. There should also be a feature=20
enquiry function to allow the API programmer to ask the underlying=20
Hibernate implementation to verify if a replication on identity table=20
will work. This would account for JDBC driver vendors and versions and=20
the realtime SQL database server vendor and version.
http://www.mail-archive.com/hib...@li.../msg052
30.html
http://forum.hibernate.org/viewtopic.php?t=3D949574&highlight=3D
http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html#repl
icate(java.lang.Object,%20org.hibernate.ReplicationMode)
RFC
Darryl
------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDE
V
_______________________________________________
hibernate-devel mailing list
hib...@li...
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
|