From 72152751a1d53cda2a2585640384c39bff98f0b4 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Sun, 7 Jan 2007 07:35:30 +0000 Subject: [PATCH] * Fixed for bug [1619933] and [1619933], now it is possible to run adempiere client with only a single connection to the application server. --- .../ejb/org/compiere/session/ServerBean.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java b/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java index 45f6350eaf..f42c3e49fb 100644 --- a/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java +++ b/serverRoot/src/main/ejb/org/compiere/session/ServerBean.java @@ -526,6 +526,62 @@ public class ServerBean implements SessionBean } // getStatus + /** + * Commit the named transaction on server + * @ejb.interface-method view-type="both" + * @param trxName + * @return true if success, false otherwise + */ + public boolean commit(String trxName) + { + boolean success = false; + Trx trx = Trx.get(trxName, false); + if (trx != null) + { + try + { + success = trx.commit(true); + } + catch (SQLException e) + { + throw new RuntimeException(e); + } + finally + { + trx.close(); + } + } + return success; + } + + /** + * Rollback the named transaction on server + * @ejb.interface-method view-type="both" + * @param trxName + * @return true if success, false otherwise + */ + public boolean rollback(String trxName) + { + boolean success = false; + Trx trx = Trx.get(trxName, false); + if (trx != null) + { + try + { + success = trx.rollback(true); + } + catch (SQLException e) + { + throw new RuntimeException(e); + } + finally + { + trx.close(); + } + } + return success; + } + /** * String Representation * @return info