ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject [1/3] git commit: fixing ODE-302
Date Mon, 26 Aug 2013 18:43:13 GMT
Updated Branches:
  refs/heads/ode-1.3.6.x 80bc8992b -> 9735d01a2


fixing ODE-302


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/570ce78d
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/570ce78d
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/570ce78d

Branch: refs/heads/ode-1.3.6.x
Commit: 570ce78d56de8413df25024076073d6906be778b
Parents: 80bc899
Author: Tammo van Lessen <tvanlessen@gmail.com>
Authored: Mon Aug 26 20:41:03 2013 +0200
Committer: Tammo van Lessen <tvanlessen@gmail.com>
Committed: Mon Aug 26 20:41:03 2013 +0200

----------------------------------------------------------------------
 Rakefile                                            |  2 +-
 .../main/java/org/apache/ode/jbi/OdeContext.java    | 12 +++++++++++-
 .../main/java/org/apache/ode/jbi/OdeLifeCycle.java  | 16 +++++++++++++++-
 3 files changed, 27 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/570ce78d/Rakefile
----------------------------------------------------------------------
diff --git a/Rakefile b/Rakefile
index e9fca10..3f9b76b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -413,7 +413,7 @@ define "ode" do
   define "jbi" do
     compile.with projects("bpel-api", "bpel-connector", "bpel-dao", "bpel-epr", "bpel-obj",
       "bpel-runtime", "scheduler-simple", "bpel-schemas", "bpel-store", "utils", "agents"),
-      AXIOM, COMMONS.logging, COMMONS.pool, JAVAX.transaction, JBI, LOG4J, WSDL4J, XERCES
+      AXIOM, COMMONS.logging, COMMONS.pool, JAVAX.transaction, GERONIMO.transaction, JBI,
LOG4J, WSDL4J, XERCES
 
     package(:jar)
     package(:jbi).tap do |jbi|

http://git-wip-us.apache.org/repos/asf/ode/blob/570ce78d/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
----------------------------------------------------------------------
diff --git a/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java b/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
index df206f7..38e1089 100644
--- a/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
+++ b/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
@@ -75,6 +75,8 @@ final public class OdeContext {
     private static OdeContext __self;
 
     private ComponentContext _context;
+    
+    private TransactionManager _txm;
 
     private Map<QName, Document> _descriptorCache = new ConcurrentHashMap<QName,
Document>();
 
@@ -171,7 +173,15 @@ final public class OdeContext {
     }
 
     public TransactionManager getTransactionManager() {
-        return (TransactionManager) getContext().getTransactionManager();
+        if (_txm != null) {
+            return (TransactionManager) getContext().getTransactionManager();
+        }
+        
+        return _txm;
+    }
+    
+    public void setTransactionManager(TransactionManager txm) {
+        _txm = txm;
     }
 
     public synchronized MyEndpointReference activateEndpoint(QName pid, Endpoint endpoint)
throws Exception {

http://git-wip-us.apache.org/repos/asf/ode/blob/570ce78d/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
----------------------------------------------------------------------
diff --git a/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java b/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
index 214da0b..2ad3f62 100644
--- a/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
+++ b/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
@@ -33,12 +33,12 @@ import javax.transaction.TransactionManager;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
 import org.apache.ode.bpel.connector.BpelServerConnector;
 import org.apache.ode.bpel.dao.BpelDAOConnectionFactoryJDBC;
 import org.apache.ode.bpel.engine.BpelServerImpl;
 import org.apache.ode.bpel.engine.ProcessAndInstanceManagementMBean;
 import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule;
-
 import org.apache.ode.bpel.iapi.BpelEventListener;
 import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
 import org.apache.ode.il.dbutil.Database;
@@ -180,6 +180,20 @@ public class OdeLifeCycle implements ComponentLifeCycle {
     }
 
     private void initDataSource() throws JBIException {
+        switch (_ode._config.getDbMode()) {
+        case EMBEDDED:
+        case INTERNAL:
+            try {
+                TransactionManager txm = new GeronimoTransactionManager();
+                _ode.setTransactionManager(txm);
+            } catch (Exception e) {
+                throw new RuntimeException("Unable to create Geronimo Transaction Manager",
e);
+            }
+            break;
+        default:
+            break;
+        }
+        
         _db = new Database(_ode._config);
         _db.setTransactionManager(_ode.getTransactionManager());
         _db.setWorkRoot(new File(_ode.getContext().getInstallRoot()));


Mime
View raw message