title: Oracle Veritas cluster failback to primary node while standby is up and running
body: <p>Have searched a lot for my question but seems like it's not something that is commonly used. The question here is around Oracle DB Veritas cluster that is based on 2 nodes, primary and stand-by.
  The scenario is customer related and we are not touching it in case of good sense. All this stuff is running on <strong>JBoss6.4</strong> and intended to follow the logic below:</p>
  
  <ol>
  <li>Application is connected to the Primary node(node1)</li>
  <li>node1 goes down and application gets connected to the stand-by node(node2).</li>
  <li>node2 is in Read-Only mode and by design node1 gets restarted and becomes reachable in 2 minutes.</li>
  <li>While this outage an application has timeout before it starts sending heartbeat messages.</li>
  <li>Once node1 is up and running the cluster should failback from node2 to node1 given that node2 is still running.</li>
  </ol>
  
  <p>The question here is to get cluster failback to node1 even if node2 is running.
  The connection string that is used:</p>
  
  <blockquote>
    <p>jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST =
    (load_balance=off)(failover=on) (ADDRESS = (PROTOCOL = TCP) (Host =
    node1) (Port = 49005)) (ADDRESS = (PROTOCOL = TCP) (Host = node2)
    (Port = 49005)) ) (CONNECT_DATA = (SERVICE_NAME = app_service)))</p>
  </blockquote>
  
  <p>Application is configured the way if it is not able to write heartbeat event to the database for 3 times, the JVM gets shutdown. Is there any ways to configure datasource connection so that it fails back to the primary node(node1) if it is available considering that node2 is up and running in RO mode?</p>
  
  <p>Thanks in advance! </p>