uchi_122495
Cirrus
May 15, 2015iControl transaction problem
Here is my code written with iControl Library for Java.
// set timeout
interfaces.getSystemSession().set_session_timeout(60);
interfaces.getSystemSession().set_transaction_timeout(30);
// get transaction
final long sessionId = interfaces.getSystemSession().get_session_identifier();
interfaces.getSystemSession().setHeader("urn:iControl", "session", Long.toString(sessionId));
interfaces.getLocalLBPool().setHeader("urn:iControl","session",Long.toString(sessionId);
// start transaction
interfaces.getSystemSession().submit_transaction();
// create pool1
interfaces.getLocalLBPool().create_v2(poolname1, lbmethod1, addressport1);
// sleep 30 sec to wait transaction will be expired
Thread.sleep(30000);
// create pool2
interfaces.getLocalLBPool().create_v2(poolname2, lbmethod2, addressport2);
// submit transaction
interfaces.getSystemSession().submit_transaction();
I expected that creating both pool1 and pool2 would be rollbacked, but pool2 was succesfully created.
Is there a way to detect transaction expiration and roleback all configuration in transaction ?