ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject [6/9] git commit: fixing ODE-302
Date Mon, 26 Aug 2013 23:20:00 GMT
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/558b2c67
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/558b2c67
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/558b2c67

Branch: refs/heads/master
Commit: 558b2c67ab45dd39e9da982cb9cb3cc32debabbc
Parents: 64be6dc
Author: Tammo van Lessen <tvanlessen@gmail.com>
Authored: Tue Aug 27 00:19:32 2013 +0200
Committer: Tammo van Lessen <tvanlessen@gmail.com>
Committed: Tue Aug 27 00:19:32 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/558b2c67/Rakefile
----------------------------------------------------------------------
diff --git a/Rakefile b/Rakefile
index d5744f4..ca91737 100644
--- a/Rakefile
+++ b/Rakefile
@@ -396,7 +396,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.pool, JAVAX.transaction, JBI, WSDL4J, XERCES, SLF4J, LOG4J
+      AXIOM, COMMONS.logging, COMMONS.pool, JAVAX.transaction, GERONIMO.transaction, JBI,
SLF4J, LOG4J, WSDL4J, XERCES
 
     package(:jar)
     package(:jbi).tap do |jbi|

http://git-wip-us.apache.org/repos/asf/ode/blob/558b2c67/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 ef2c67a..3fabd87 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/558b2c67/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 46fbce9..40fb044 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 = Database.create(_ode._config);
         _db.setTransactionManager(_ode.getTransactionManager());
         _db.setWorkRoot(new File(_ode.getContext().getInstallRoot()));


Mime
View raw message