Author: tabish
Date: Wed Oct 6 23:12:16 2010
New Revision: 1005289
URL: http://svn.apache.org/viewvc?rev=1005289&view=rev
Log:
Add Commit and Rollback
Modified:
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp
activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h
Modified: activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp?rev=1005289&r1=1005288&r2=1005289&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.cpp Wed Oct
6 23:12:16 2010
@@ -125,3 +125,37 @@ cms_status closeSession(CMS_Session* ses
return result;
}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status commitSession(CMS_Session* session) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(session != NULL) {
+
+ try{
+ session->session->commit();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms_status rollbackSession(CMS_Session* session) {
+
+ cms_status result = CMS_SUCCESS;
+
+ if(session != NULL) {
+
+ try{
+ session->session->rollback();
+ } catch(...) {
+ result = CMS_ERROR;
+ }
+ }
+
+ return result;
+}
Modified: activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h?rev=1005289&r1=1005288&r2=1005289&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h (original)
+++ activemq/activemq-cpp/trunk/activemq-c/src/main/c/CMS_Session.h Wed Oct 6
23:12:16 2010
@@ -73,6 +73,22 @@ cms_status destroySession(CMS_Session* s
*/
cms_status closeSession(CMS_Session* session);
+/**
+ * Commit the current transaction in progress for the Session.
+ *
+ * @param session
+ * The Session that will have its current transaction committed.
+ */
+cms_status commitSession(CMS_Session* session);
+
+/**
+ * Roll back the current transaction in progress for the Session.
+ *
+ * @param session
+ * The Session that will have its current transaction rolled back.
+ */
+cms_status rollbackSession(CMS_Session* session);
+
#ifdef __cplusplus
}
#endif