This topic applies to Java version only
This section describes how to configure and run dRS.It is crucial to follow
the sequence of actions so that dRS can detect new/changed objects and
replicate them during replication sessions.
// Read or create the Configuration as usual
Configuration cfg = new Configuration().configure("your-hibernate.cfg.xml");
// Let the ReplicationConfigurator adjust the configuration
ReplicationConfigurator.configure(cfg);
// Create the SessionFactory as usual
SessionFactory sessionFactory = cfg.buildSessionFactory();
// Create the Session as usual
Session session = sessionFactory.openSession();
// Let the ReplicationConfigurator install the listeners to the Session
ReplicationConfigurator.install(session, cfg);
//Update objects as usual
Transaction tx = session.beginTransaction();
Pilot john = (Pilot) session.createCriteria(Pilot.class)