Running DRS

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)

Some precautions to take into consideration:
  1. Do not open more than one dRS replication session against the same RDBMS concurrently. Otherwise data corruption will occur.
  2. When dRS is in progress, do not modify the data in the RDBMS by using SQL or Hibernate. Otherwise data corruption will occur.