You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2007/11/30 21:00:18 UTC

svn commit: r599937 - in /ode/trunk: ./ axis2/src/main/java/org/apache/ode/axis2/ dao-jpa/src/main/java/org/apache/ode/dao/jpa/

Author: mriou
Date: Fri Nov 30 12:00:15 2007
New Revision: 599937

URL: http://svn.apache.org/viewvc?rev=599937&view=rev
Log:
Merging changes from 1.1 branch r599240:r599043.

Modified:
    ode/trunk/Rakefile
    ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionFactoryImpl.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
    ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java

Modified: ode/trunk/Rakefile
URL: http://svn.apache.org/viewvc/ode/trunk/Rakefile?rev=599937&r1=599936&r2=599937&view=diff
==============================================================================
--- ode/trunk/Rakefile (original)
+++ ode/trunk/Rakefile Fri Nov 30 12:00:15 2007
@@ -20,6 +20,7 @@
 require "buildr/xmlbeans.rb"
 require "buildr/openjpa"
 require "buildr/javacc"
+require "buildr/antlr"
 require "buildr/jetty"
 require "buildr/hibernate"
 
@@ -30,6 +31,7 @@
 ACTIVEMQ            = "org.apache.activemq:apache-activemq:jar:4.1.1"
 ANNONGEN            = "annogen:annogen:jar:0.1.0"
 ANT                 = "ant:ant:jar:1.6.5"
+ANTLR               = "org.antlr:antlr:jar:3.0"
 AXIOM               = [ group("axiom-api", "axiom-impl", "axiom-dom",
                         :under=>"org.apache.ws.commons.axiom", :version=>"1.2.5") ]
 AXIS2_WAR           = "org.apache.axis2:axis2-webapp:war:1.3"
@@ -77,8 +79,8 @@
 JENCKS              = "org.jencks:jencks:jar:all:1.3"
 JIBX                = "jibx:jibx-run:jar:1.1-beta3"
 LOG4J               = "log4j:log4j:jar:1.2.13"
-OPENJPA             = ["org.apache.openjpa:openjpa-all:jar:#{Buildr::OpenJPA::VERSION}",
-                       "net.sourceforge.serp:serp:jar:1.12.0"]
+OPENJPA             = ["org.apache.openjpa:openjpa:jar:1.0.1",
+                       "net.sourceforge.serp:serp:jar:1.13.1"]
 SAXON               = group("saxon", "saxon-xpath", "saxon-dom", :under=>"net.sf.saxon", :version=>"8.7")
 SERVICEMIX          = group("servicemix-core", "servicemix-shared", "servicemix-services",
                         :under=>"org.apache.servicemix", :version=>"3.1-incubating")
@@ -97,7 +99,7 @@
 )
 XBEAN               = group("xbean-classloader", "xbean-kernel", "xbean-server", "xbean-spring",
                         :under=>"org.apache.xbean", :version=>"2.8")
-XMLBEANS            = "xmlbeans:xbean:jar:2.2.0"
+XMLBEANS            = "org.apache.xmlbeans:xmlbeans:jar:2.3.0"
 
 repositories.remote << "http://pxe.intalio.org/public/maven2"
 repositories.remote << "http://people.apache.org/repo/m2-incubating-repository"
@@ -439,6 +441,14 @@
   desc "ODE JCA Server"
   define "jca-server" do
     compile.with projects("jca-ra", "utils"), COMMONS.logging
+    package :jar
+  end
+
+  desc "ODE SimPEL"
+  define "simpel" do
+    pkg_name = "org.apache.ode.simpel.antlr"
+    compile.from antlr(_("src/main/antlr"), {:in_package=>pkg_name, :token=>pkg_name})
+    compile.with file(_("lib/e4x-grammar-0.1.jar")), ANTLR
     package :jar
   end
 

Modified: ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=599937&r1=599936&r2=599937&view=diff
==============================================================================
--- ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java (original)
+++ ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java Fri Nov 30 12:00:15 2007
@@ -28,7 +28,8 @@
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
+import javax.transaction.*;
+import javax.transaction.xa.XAResource;
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
 
@@ -75,6 +76,7 @@
 public class ODEServer {
 
     protected final Log __log = LogFactory.getLog(getClass());
+    protected final Log __logTx = LogFactory.getLog("org.apache.ode.tx");
 
     private static final Messages __msgs = Messages.getMessages(Messages.class);
 
@@ -387,6 +389,8 @@
             Class txFactClass = this.getClass().getClassLoader().loadClass(txFactoryName);
             Object txFact = txFactClass.newInstance();
             _txMgr = (TransactionManager) txFactClass.getMethod("getTransactionManager", (Class[]) null).invoke(txFact);
+            if (__logTx.isDebugEnabled())
+                _txMgr = new DebugTxMgr(_txMgr);
         } catch (Exception e) {
             __log.fatal("Couldn't initialize a transaction manager with factory: " + txFactoryName, e);
             throw new ServletException("Couldn't initialize a transaction manager with factory: " + txFactoryName, e);
@@ -584,4 +588,103 @@
                 __log.debug("Ignoring store event: " + pse);
         }
     }
+
+    // Transactional debugging stuff, to track down all these little annoying bugs.
+    private class DebugTxMgr implements TransactionManager {
+        private TransactionManager _tm;
+
+        public DebugTxMgr(TransactionManager tm) {
+            _tm = tm;
+        }
+
+        public void begin() throws NotSupportedException, SystemException {
+            __logTx.debug("Txm begin");
+            _tm.begin();
+        }
+
+        public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException {
+            __logTx.debug("Txm commit");
+            for (StackTraceElement traceElement : Thread.currentThread().getStackTrace()) {
+                __logTx.debug(traceElement.toString());
+            }
+            _tm.commit();
+        }
+
+        public int getStatus() throws SystemException {
+            __logTx.debug("Txm status");
+            return _tm.getStatus();
+        }
+
+        public Transaction getTransaction() throws SystemException {
+            Transaction tx = _tm.getTransaction();
+            __logTx.debug("Txm get tx " + tx);
+            return tx == null ? null : new DebugTx(tx);
+        }
+
+        public void resume(Transaction transaction) throws IllegalStateException, InvalidTransactionException, SystemException {
+            __logTx.debug("Txm resume");
+            _tm.resume(transaction);
+        }
+
+        public void rollback() throws IllegalStateException, SecurityException, SystemException {
+            __logTx.debug("Txm rollback");
+            _tm.rollback();
+        }
+
+        public void setRollbackOnly() throws IllegalStateException, SystemException {
+            __logTx.debug("Txm set rollback");
+            _tm.setRollbackOnly();
+        }
+
+        public void setTransactionTimeout(int i) throws SystemException {
+            __logTx.debug("Txm set tiemout " + i);
+            _tm.setTransactionTimeout(i);
+        }
+
+        public Transaction suspend() throws SystemException {
+            __logTx.debug("Txm suspend");
+            return _tm.suspend();
+        }
+    }
+
+    private class DebugTx implements Transaction {
+        private Transaction _tx;
+
+        public DebugTx(Transaction tx) {
+            _tx = tx;
+        }
+
+        public void commit() throws HeuristicMixedException, HeuristicRollbackException, RollbackException, SecurityException, SystemException {
+            __logTx.debug("Tx commit");
+            _tx.commit();
+        }
+
+        public boolean delistResource(XAResource xaResource, int i) throws IllegalStateException, SystemException {
+            return _tx.delistResource(xaResource, i);
+        }
+
+        public boolean enlistResource(XAResource xaResource) throws IllegalStateException, RollbackException, SystemException {
+            return _tx.enlistResource(xaResource);
+        }
+
+        public int getStatus() throws SystemException {
+            return _tx.getStatus();
+        }
+
+        public void registerSynchronization(Synchronization synchronization) throws IllegalStateException, RollbackException, SystemException {
+            __logTx.debug("Synchronization registration on " + synchronization.getClass().getName());
+            _tx.registerSynchronization(synchronization);
+        }
+
+        public void rollback() throws IllegalStateException, SystemException {
+            __logTx.debug("Tx rollback");
+            _tx.rollback();
+        }
+
+        public void setRollbackOnly() throws IllegalStateException, SystemException {
+            __logTx.debug("Tx set rollback");
+            _tx.setRollbackOnly();
+        }
+    }
+
 }

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionFactoryImpl.java?rev=599937&r1=599936&r2=599937&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionFactoryImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionFactoryImpl.java Fri Nov 30 12:00:15 2007
@@ -137,7 +137,6 @@
     private class TxMgrProvider implements ManagedRuntime {
         public TxMgrProvider() {
         }
-
         public TransactionManager getTransactionManager() throws Exception {
             return _tm;
         }
@@ -149,88 +148,9 @@
             // there is no generic support for setting the rollback cause
             return null;
         }
-    }
-
-    private class DebugTxMgr implements TransactionManager {
-        private TransactionManager _tm;
-
-        public DebugTxMgr(TransactionManager tm) {
-            _tm = tm;
-        }
-
-        public void begin() throws NotSupportedException, SystemException {
-            _tm.begin();
-        }
-
-        public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException {
-            _tm.commit();
-        }
-
-        public int getStatus() throws SystemException {
-            return _tm.getStatus();
-        }
-
-        public Transaction getTransaction() throws SystemException {
-            Transaction tx = _tm.getTransaction();
-            __log.debug("JPA get transaction" + tx);
-            return new DebugTx(tx);
-        }
-
-        public void resume(Transaction transaction) throws IllegalStateException, InvalidTransactionException, SystemException {
-            _tm.resume(transaction);
-        }
-
-        public void rollback() throws IllegalStateException, SecurityException, SystemException {
-            _tm.rollback();
-        }
-
-        public void setRollbackOnly() throws IllegalStateException, SystemException {
-            _tm.setRollbackOnly();
-        }
-
-        public void setTransactionTimeout(int i) throws SystemException {
-            _tm.setTransactionTimeout(i);
-        }
-
-        public Transaction suspend() throws SystemException {
-            return _tm.suspend();
+        public Object getTransactionKey() throws Exception, SystemException {
+            return _tm.getTransaction();
         }
     }
 
-    private class DebugTx implements Transaction {
-        private Transaction _tx;
-
-        public DebugTx(Transaction tx) {
-            _tx = tx;
-        }
-
-        public void commit() throws HeuristicMixedException, HeuristicRollbackException, RollbackException, SecurityException, SystemException {
-            _tx.commit();
-        }
-
-        public boolean delistResource(XAResource xaResource, int i) throws IllegalStateException, SystemException {
-            return _tx.delistResource(xaResource, i);
-        }
-
-        public boolean enlistResource(XAResource xaResource) throws IllegalStateException, RollbackException, SystemException {
-            return _tx.enlistResource(xaResource);
-        }
-
-        public int getStatus() throws SystemException {
-            return _tx.getStatus();
-        }
-
-        public void registerSynchronization(Synchronization synchronization) throws IllegalStateException, RollbackException, SystemException {
-            __log.debug("Synchronization registration on " + synchronization.getClass().getName());
-            _tx.registerSynchronization(synchronization);
-        }
-
-        public void rollback() throws IllegalStateException, SystemException {
-            _tx.rollback();
-        }
-
-        public void setRollbackOnly() throws IllegalStateException, SystemException {
-            _tx.setRollbackOnly();
-        }
-    }
 }

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java?rev=599937&r1=599936&r2=599937&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java Fri Nov 30 12:00:15 2007
@@ -24,19 +24,7 @@
 import org.apache.ode.bpel.dao.ProcessDAO;
 import org.apache.ode.bpel.dao.ProcessInstanceDAO;
 
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.OneToMany;
-import javax.persistence.Query;
-import javax.persistence.Table;
+import javax.persistence.*;
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -64,7 +52,7 @@
 
     @Basic @Column(name="PROCESS_ID")
     private String _processId;
-	@Basic @Column(name="NUMBER_OF_INSTANCES")
+	@Transient
     private int _numInstances;
 	@Basic @Column(name="PROCESS_TYPE")
     private String _processType;

Modified: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java?rev=599937&r1=599936&r2=599937&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java (original)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessInstanceDAOImpl.java Fri Nov 30 12:00:15 2007
@@ -231,7 +231,7 @@
         Query qry = getEM().createNamedQuery("ScopeById");
         qry.setParameter("sid", scopeInstanceId);
         qry.setParameter("instance", this);
-        return getSingleResult(qry);
+        return (ScopeDAO) qry.getSingleResult();
 	}
 
 	public Collection<ScopeDAO> getScopes(String scopeName) {