Cherry-pick from https://gerrit.onos.onlab.us/#/c/337/

Add a rollback method for clearing cache of IDeviceObject.
Call the rollback method in Forwarding.class.

Change-Id: I32c85708a5595c7cd70f239eaefd1f2f96812de1
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java
index 2eddadf..9818b1b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java
@@ -14,6 +14,8 @@
 	public IDeviceObject getDeviceByIP(int ipv4Address);
 	public void changeDeviceAttachments(IDevice device);
 	public void changeDeviceIPv4Address(IDevice device);
+	public void rollback();
+	public void commit();
 	
 	public void addOnosDevice(OnosDevice onosDevice);
 }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
index 0699491..94954a6 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
@@ -162,6 +162,20 @@
 	}
 
 	/***
+	 * This function is for closing the DB transaction properly.
+	 * After you use any DB operation, to clear the cache of transaction, it should be called.
+	 */
+	@Override
+	public void rollback() {
+		ope.rollback();
+	}
+	
+	@Override
+	public void commit(){
+		ope.commit();
+	}
+
+	/***
 	 * This function is for getting the Device from the DB by IP address of the device.
 	 * @param ip The device ip address you want to get from the DB.
 	 * @return IDeviceObject you want to get.