You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by je...@apache.org on 2010/08/18 06:12:59 UTC

svn commit: r986561 [13/13] - in /ode/trunk: ./ axis2-war/ axis2-war/src/main/assembly/ axis2-war/src/test/java/org/apache/ode/axis2/ axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/ axis2-war/src/test/java/org/apache/ode/bpel/dao/ axis2-w...

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/ScopeDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/ScopeDAOImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/ScopeDAOImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/ScopeDAOImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.bpel;
+
+import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.dao.bpel.CorrelationSetDAO;
+import org.apache.ode.dao.bpel.PartnerLinkDAO;
+import org.apache.ode.dao.bpel.ProcessInstanceDAO;
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.ScopeStateEnum;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+
+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.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Query;
+import javax.persistence.Table;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+@Entity
+@Table(name="ODE_SCOPE")
+@NamedQueries({
+    @NamedQuery(name="ScopeEvents", query="SELECT se FROM EventDAOImpl as se WHERE se._scopeId = :sid"),
+    @NamedQuery(name=ScopeDAOImpl.SELECT_SCOPE_IDS_BY_PROCESS, query="select s._scopeInstanceId from ScopeDAOImpl as s where s._processInstance._process = :process"),
+    @NamedQuery(name=ScopeDAOImpl.SELECT_SCOPE_IDS_BY_INSTANCE, query="select s._scopeInstanceId from ScopeDAOImpl as s where s._processInstance = :instance"),
+    @NamedQuery(name=ScopeDAOImpl.DELETE_SCOPES_BY_SCOPE_IDS, query="delete from ScopeDAOImpl as s where s._scopeInstanceId in(:ids)")
+})
+public class ScopeDAOImpl extends BpelDAO implements ScopeDAO {
+    public final static String SELECT_SCOPE_IDS_BY_PROCESS = "SELECT_SCOPE_IDS_BY_PROCESS";
+    public final static String SELECT_SCOPE_IDS_BY_INSTANCE = "SELECT_SCOPE_IDS_BY_INSTANCE";
+    public final static String DELETE_SCOPES_BY_SCOPE_IDS = "DELETE_SCOPES_BY_SCOPE_IDS";
+
+    @Id @Column(name="SCOPE_ID")
+    @GeneratedValue(strategy= GenerationType.AUTO)
+    private Long _scopeInstanceId;
+
+    @Basic @Column(name="MODEL_ID")
+    private int _modelId;
+    @Basic @Column(name="SCOPE_NAME")
+    private String _name;
+    @Basic @Column(name="SCOPE_STATE")
+    private String _scopeState;
+
+    @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST})
+    @JoinColumn(name="PARENT_SCOPE_ID")
+    private ScopeDAOImpl _parentScope;
+
+    @OneToMany(targetEntity=ScopeDAOImpl.class,mappedBy="_parentScope",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
+    private Collection<ScopeDAO> _childScopes = new ArrayList<ScopeDAO>();
+    @OneToMany(targetEntity=CorrelationSetDAOImpl.class,mappedBy="_scope",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
+    private Collection<CorrelationSetDAO> _correlationSets = new ArrayList<CorrelationSetDAO>();
+    @OneToMany(targetEntity=PartnerLinkDAOImpl.class,mappedBy="_scope",fetch= FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
+    private Collection<PartnerLinkDAO> _partnerLinks = new ArrayList<PartnerLinkDAO>();
+    @OneToMany(targetEntity=XmlDataDAOImpl.class,mappedBy="_scope",fetch=FetchType.LAZY,cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
+    private Collection<XmlDataDAO> _variables = new ArrayList<XmlDataDAO>();
+    @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @JoinColumn(name="PROCESS_INSTANCE_ID")
+    private ProcessInstanceDAOImpl _processInstance;
+
+    public ScopeDAOImpl() {}
+    public ScopeDAOImpl(ScopeDAOImpl parentScope, String name, int scopeModelId, ProcessInstanceDAOImpl pi) {
+        _parentScope = parentScope;
+        _name = name;
+        _modelId = scopeModelId;
+        _processInstance = pi;
+    }
+
+    public PartnerLinkDAO createPartnerLink(int plinkModelId, String pLinkName,
+            String myRole, String partnerRole) {
+        PartnerLinkDAOImpl pl = new PartnerLinkDAOImpl(plinkModelId, pLinkName, myRole, partnerRole);
+        pl.setScope(this);
+        _partnerLinks.add(pl);
+        return pl;
+    }
+
+    public Collection<ScopeDAO> getChildScopes() {
+        return _childScopes;
+    }
+
+    public CorrelationSetDAO getCorrelationSet(String corrSetName) {
+        CorrelationSetDAO ret = null;
+        for (CorrelationSetDAO csElement : _correlationSets) {
+            if ( csElement.getName().equals(corrSetName)) ret = csElement;
+        }
+
+        if ( ret == null ) {
+            // Apparently the caller knows there should be a correlation set
+            // in here. Create a new set if one does not exist.
+            // Not sure I understand this implied object creation and why
+            // an explicit create pattern isn't used ( i.e. similar to
+            // PartnerLink creation )
+            ret = new CorrelationSetDAOImpl(this,corrSetName);
+            // Persist the new correlation set to generate an ID
+            getEM().persist(ret);
+            _correlationSets.add(ret);
+        }
+
+        return ret;
+    }
+
+    public Collection<CorrelationSetDAO> getCorrelationSets() {
+        return _correlationSets;
+    }
+
+    public int getModelId() {
+        return _modelId;
+    }
+
+    public String getName() {
+        return _name;
+    }
+
+    public ScopeDAO getParentScope() {
+        return _parentScope;
+    }
+
+    public PartnerLinkDAO getPartnerLink(int plinkModelId) {
+        for (PartnerLinkDAO pLink : getPartnerLinks()) {
+            if (pLink.getPartnerLinkModelId() == plinkModelId) {
+                return pLink;
+            }
+        }
+        return null;
+    }
+
+    public Collection<PartnerLinkDAO> getPartnerLinks() {
+        return _partnerLinks;
+    }
+
+    public ProcessInstanceDAO getProcessInstance() {
+        return _processInstance;
+    }
+
+    public Long getScopeInstanceId() {
+        return _scopeInstanceId;
+    }
+
+    public ScopeStateEnum getState() {
+        return ScopeStateEnum.valueOf(_scopeState);
+    }
+
+    public XmlDataDAO getVariable(String varName) {
+        XmlDataDAO ret = null;
+
+        for (XmlDataDAO xmlElement : _variables) {
+            if ( xmlElement.getName().equals(varName)) return xmlElement;
+        }
+
+        ret = new XmlDataDAOImpl(this,varName);
+        _variables.add(ret);
+
+        return ret;
+    }
+
+    public Collection<XmlDataDAO> getVariables() {
+        return _variables;
+    }
+
+    public List<BpelEvent> listEvents() {
+        List<BpelEvent> result = new ArrayList<BpelEvent>();
+        Query qry = getEM().createNamedQuery("ScopeEvents");
+        qry.setParameter("sid", _scopeInstanceId);
+        for (Object eventDao : qry.getResultList()) {
+            result.add(((EventDAOImpl)eventDao).getEvent());
+        }
+        return result;
+    }
+
+    public void setState(ScopeStateEnum state) {
+        _scopeState = state.toString();
+    }
+
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataDAOImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataDAOImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataDAOImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.bpel;
+
+import org.apache.ode.dao.bpel.ScopeDAO;
+import org.apache.ode.dao.bpel.XmlDataDAO;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+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.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="ODE_XML_DATA")
+@NamedQueries({
+    @NamedQuery(name=XmlDataDAOImpl.SELECT_XMLDATA_IDS_BY_PROCESS, query="select distinct x._id from XmlDataDAOImpl as x where x._scope._processInstance._process = :process"),
+    @NamedQuery(name=XmlDataDAOImpl.SELECT_XMLDATA_IDS_BY_INSTANCE, query="select distinct x._id from XmlDataDAOImpl as x where x._scope._processInstance = :instance"),
+    @NamedQuery(name=XmlDataDAOImpl.DELETE_XMLDATA_BY_SCOPE_IDS, query="delete from XmlDataDAOImpl as x where x._scopeId in(:scopeIds)")
+})
+public class XmlDataDAOImpl implements XmlDataDAO {
+    public final static String SELECT_XMLDATA_IDS_BY_PROCESS = "SELECT_XMLDATA_IDS_BY_PROCESS";
+    public final static String SELECT_XMLDATA_IDS_BY_INSTANCE = "SELECT_XMLDATA_IDS_BY_INSTANCE";
+    public final static String DELETE_XMLDATA_BY_SCOPE_IDS = "DELETE_XMLDATA_BY_SCOPE_IDS";
+
+    @Id @Column(name="XML_DATA_ID")
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    @SuppressWarnings("unused")
+    private Long _id;
+    @Lob @Column(name="DATA")
+    private String _data;
+    @Transient
+    private Node _node;
+    @Basic @Column(name="IS_SIMPLE_TYPE")
+    private boolean _isSimpleType;
+    @Basic @Column(name="NAME")
+    private String _name;
+
+    @OneToMany(targetEntity=XmlDataProperty.class,mappedBy="_xmlData",fetch=FetchType.EAGER,cascade={CascadeType.ALL})
+    private Collection<XmlDataProperty> _props = new ArrayList<XmlDataProperty>();
+
+    @SuppressWarnings("unused")
+    @Basic @Column(name="SCOPE_ID", nullable=true, insertable=false, updatable=false)
+    private Long _scopeId;
+    @ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST}) @JoinColumn(name="SCOPE_ID")
+    private ScopeDAOImpl _scope;
+
+    public XmlDataDAOImpl() {}
+    public XmlDataDAOImpl(ScopeDAOImpl scope, String name){
+        _scope = scope;
+        _name = name;
+    }
+
+    public Node get() {
+        if ( _node == null && _data != null ) {
+           if(_isSimpleType){
+                Document d = DOMUtils.newDocument();
+                // we create a dummy wrapper element
+                // prevents some apps from complaining
+                // when text node is not actual child of document
+                Element e = d.createElement("text-node-wrapper");
+                Text tnode = d.createTextNode(_data);
+                d.appendChild(e);
+                e.appendChild(tnode);
+                _node = tnode;
+           }else{
+              try{
+                  _node = DOMUtils.stringToDOM(_data);
+              }catch(Exception e){
+                  throw new RuntimeException(e);
+              }
+           }
+        }
+
+        return _node;
+    }
+
+    public String getName() {
+        return _name;
+    }
+
+    public String getProperty(String propertyName) {
+        for (XmlDataProperty prop : _props) {
+            if (prop.getPropertyKey().equals(propertyName)) return prop.getPropertyValue();
+        }
+        return null;
+    }
+
+    private XmlDataProperty getPropertyObject(String propertyName) {
+        for (XmlDataProperty prop : _props) {
+            if (prop.getPropertyKey().equals(propertyName)) return prop;
+        }
+        return null;
+    }
+
+    public ScopeDAO getScopeDAO() {
+        return _scope;
+    }
+
+    public boolean isNull() {
+        return _data == null;
+    }
+
+    public void remove() {
+
+    }
+
+    public void set(Node val) {
+        _node = val;
+        if ( val instanceof Element ) {
+            _isSimpleType = false;
+            _data = DOMUtils.domToString(val);
+        } else if (_node != null) {
+            _isSimpleType = true;
+            _data = _node.getNodeValue();
+        }
+    }
+
+    public void setProperty(String pname, String pvalue) {
+        XmlDataProperty prop = getPropertyObject(pname);
+        if (prop == null) {
+            _props.add(new XmlDataProperty(pname, pvalue, this));
+        } else {
+            prop.setPropertyValue(pvalue);
+        }
+    }
+
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataProperty.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataProperty.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataProperty.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/bpel/XmlDataProperty.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.bpel;
+
+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.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="ODE_XML_DATA_PROP")
+@NamedQueries({
+    @NamedQuery(name=XmlDataProperty.DELETE_XML_DATA_PROPERTIES_BY_XML_DATA_IDS, query="delete from XmlDataProperty as p where p._xmlDataId in (:xmlDataIds)")
+})
+public class XmlDataProperty {
+    public final static String DELETE_XML_DATA_PROPERTIES_BY_XML_DATA_IDS = "DELETE_XML_DATA_PROPERTIES_BY_XML_DATA_IDS";
+
+    @Id @Column(name="ID")
+    @GeneratedValue(strategy= GenerationType.AUTO)
+    @SuppressWarnings("unused")
+    private Long _id;
+    @Basic @Column(name="PROP_KEY")
+    private String propertyKey;
+    @Basic @Column(name="PROP_VALUE")
+    private String propertyValue;
+
+    @SuppressWarnings("unused")
+    @Basic @Column(name="XML_DATA_ID", insertable=false, updatable=false, nullable=true)
+    private Long _xmlDataId;
+    @ManyToOne(fetch= FetchType.LAZY,cascade={CascadeType.PERSIST})
+    @JoinColumn(name="XML_DATA_ID")
+    @SuppressWarnings("unused")
+    private XmlDataDAOImpl _xmlData;
+
+    public XmlDataProperty() {
+    }
+    public XmlDataProperty(String propertyKey, String propertyValue, XmlDataDAOImpl xmlData) {
+        this.propertyKey = propertyKey;
+        this.propertyValue = propertyValue;
+        this._xmlData = xmlData;
+    }
+
+    public String getPropertyKey() {
+        return propertyKey;
+    }
+
+    public void setPropertyKey(String propertyKey) {
+        this.propertyKey = propertyKey;
+    }
+
+    public String getPropertyValue() {
+        return propertyValue;
+    }
+
+    public void setPropertyValue(String propertyValue) {
+        this.propertyValue = propertyValue;
+    }
+
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAO.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAO.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAO.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAO.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+public class ConfStoreDAO {
+
+    EntityManager getEM() {
+        return ConfStoreDAOConnectionImpl.getThreadLocal().get().getEntityManager();
+    }
+
+    protected void delete() {
+        getEM().remove(this);
+    }
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAOConnectionImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAOConnectionImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAOConnectionImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ConfStoreDAOConnectionImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.dao.jpa.JpaConnection;
+import org.apache.ode.dao.jpa.JpaOperator;
+import org.apache.ode.dao.store.ConfStoreDAOConnection;
+import org.apache.ode.dao.store.DeploymentUnitDAO;
+
+import javax.persistence.EntityManager;
+import javax.transaction.TransactionManager;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+public class ConfStoreDAOConnectionImpl extends JpaConnection implements ConfStoreDAOConnection {
+	
+	private static Log LOG = LogFactory.getLog(ConfStoreDAOConnectionImpl.class);
+	
+    static final ThreadLocal<ConfStoreDAOConnectionImpl> _connections = new ThreadLocal<ConfStoreDAOConnectionImpl>();
+
+
+    public ConfStoreDAOConnectionImpl(EntityManager mgr, TransactionManager txMgr, JpaOperator operator) {
+        super(mgr, txMgr, operator);
+    }
+
+    public void close() {
+    }
+
+    public DeploymentUnitDAO createDeploymentUnit(String name) {
+    	_txCtx.begin();
+        DeploymentUnitDaoImpl du = new DeploymentUnitDaoImpl();
+        du.setName(name);
+        du.setDeployDate(new Date());
+        _em.persist(du);
+        _txCtx.commit();
+        return du;
+    }
+
+    public DeploymentUnitDAO getDeploymentUnit(String name) {
+    	_txCtx.begin();
+    	DeploymentUnitDAO dao= _em.find(DeploymentUnitDaoImpl.class, name);
+        _txCtx.commit();
+        return dao;
+    }
+
+    public Collection<DeploymentUnitDAO> getDeploymentUnits() {
+    	_txCtx.begin();
+    	Collection<DeploymentUnitDAO> dao = _em.createQuery("SELECT du from DeploymentUnitDaoImpl du").getResultList();
+        _txCtx.commit();
+        return dao;
+    }
+
+    public long getNextVersion() {
+    	_txCtx.begin();
+        List<VersionTrackerDAOImpl> res = _em.createQuery("select v from VersionTrackerDAOImpl v").getResultList();
+        _txCtx.commit();
+        if (res.size() == 0) return 1;
+        else {
+            VersionTrackerDAOImpl vt = res.get(0);
+            return vt.getVersion() + 1;
+        }
+    }
+
+    public void setVersion(long version) {
+    	_txCtx.begin();
+        List<VersionTrackerDAOImpl> res = _em.createQuery("select v from VersionTrackerDAOImpl v").getResultList();
+        VersionTrackerDAOImpl vt;
+        if (res.size() == 0) vt = new VersionTrackerDAOImpl();
+        else vt = res.get(0);
+        vt.setVersion(version);
+        _em.persist(vt);
+        _txCtx.commit();
+    }
+    
+    public static ThreadLocal<ConfStoreDAOConnectionImpl> getThreadLocal() {
+        return _connections;
+    }
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/DeploymentUnitDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/DeploymentUnitDaoImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/DeploymentUnitDaoImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/DeploymentUnitDaoImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import org.apache.ode.bpel.iapi.ProcessState;
+import org.apache.ode.dao.store.DeploymentUnitDAO;
+import org.apache.ode.dao.store.ProcessConfDAO;
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.MemberOfFunction;
+
+import javax.persistence.*;
+import javax.xml.namespace.QName;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="STORE_DU")
+public class DeploymentUnitDaoImpl extends ConfStoreDAO implements DeploymentUnitDAO {
+
+    @OneToMany(targetEntity=ProcessConfDaoImpl.class,mappedBy="_du",fetch=FetchType.EAGER,cascade={CascadeType.ALL})
+    private Collection<ProcessConfDaoImpl> _processes = new HashSet<ProcessConfDaoImpl>();
+
+    @Basic @Column(name="DEPLOYER")
+    private String _deployer;
+
+    @Basic @Column(name="DEPLOYDT")
+    private Date _deployDate;
+
+    @Basic @Column(name="DIR")
+    private String _dir;
+
+    @Id @Column(name="NAME")
+    private String _name;
+
+    public Collection<? extends ProcessConfDAO> getProcesses() {
+        return _processes;
+    }
+
+    public void setProcesses(Collection<ProcessConfDaoImpl> processes) {
+        _processes = processes;
+    }
+
+    /**
+     * The user that deployed the process.
+     * @hibernate.property
+     *    column="deployer"
+     */
+    public String getDeployer() {
+        return _deployer;
+    }
+
+    public void setDeployer(String deployer) {
+        _deployer = deployer;
+    }
+
+    /**
+     * The date the process was deployed.
+     * @hibernate.property
+     *    column="DEPLOYDT"
+     */
+    public Date getDeployDate() {
+        return _deployDate;
+    }
+
+    public void setDeployDate(Date deployDate) {
+        _deployDate = deployDate;
+    }
+
+    /**
+     * @hibernate.id generator-class="assigned"
+     * @hibernate.column name="NAME"
+     */
+    public String getName() {
+        return _name;
+    }
+
+    public void setName(String name) {
+        _name = name;
+    }
+
+    /**
+     * @hibernate.property column="DIR"
+     */
+    public String getDeploymentUnitDir() {
+        return _dir;
+    }
+
+    public void setDeploymentUnitDir(String dir) {
+        _dir = dir;
+    }
+
+    public void delete() {
+        super.delete();
+    }
+
+    public ProcessConfDAO createProcess(QName pid, QName type, long version) {
+        ProcessConfDaoImpl p = new ProcessConfDaoImpl();
+        p.setPID(pid);
+        p.setType(type);
+        p.setDeploymentUnit(this);
+        p.setState(ProcessState.ACTIVE);
+        p.setVersion(version);
+        getEM().persist(p);
+        _processes.add(p);
+        getEM().persist(this);
+        return p;
+    }
+
+    public ProcessConfDAO getProcess(final QName pid) {
+        return CollectionsX.find_if(_processes,new MemberOfFunction<ProcessConfDAO>() {
+            @Override
+            public boolean isMember(ProcessConfDAO o) {
+                return o.getPID().equals(pid);
+            }
+
+        });
+    }
+
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfDaoImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfDaoImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfDaoImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import org.apache.ode.bpel.iapi.ProcessState;
+import org.apache.ode.dao.store.ProcessConfDAO;
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.UnaryFunction;
+
+import javax.persistence.*;
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="STORE_PROCESS")
+public class ProcessConfDaoImpl extends ConfStoreDAO implements ProcessConfDAO {
+
+    @ManyToOne(targetEntity=DeploymentUnitDaoImpl.class,fetch=FetchType.EAGER,cascade={CascadeType.ALL})
+    @JoinColumn(name="DU")
+    private DeploymentUnitDaoImpl _du;
+
+    @OneToMany(fetch=FetchType.EAGER,cascade={CascadeType.ALL})
+    @MapKey(name="_key")
+    @JoinTable(name="STORE_PROC_TO_PROP")
+    private Map<String,ProcessConfPropertyDaoImpl> _properties = new HashMap<String,ProcessConfPropertyDaoImpl>();
+
+    @Id @Column(name="PID")
+    private String _processId;
+
+    @Basic @Column(name="TYPE")
+    private String _type;
+
+    @Basic @Column(name="VERSION")
+    private long _version;
+
+    @Basic @Column(name="STATE")
+    private String _state;
+
+    public DeploymentUnitDaoImpl getDeploymentUnit() {
+        return _du;
+    }
+
+    public void setDeploymentUnit(DeploymentUnitDaoImpl du) {
+        _du = du;
+    }
+
+    /**
+     *
+     * @hibernate.id generator-class="assigned"
+     * @hibernate.column
+     *  name="PID"
+     *  not-null="true"
+     */
+    public String getPID_() {
+        return _processId;
+    }
+
+    public void setPID_(String processId) {
+        _processId = processId;
+    }
+
+
+    /**
+     * The type of the process (BPEL process definition name).
+     * @hibernate.property
+     *     column="TYPE"
+     */
+    public String getType_() {
+        return _type;
+    }
+
+    public void setType_(String type) {
+        _type = type;
+    }
+
+
+    /**
+     * The process version.
+     * @hibernate.property
+     *    column="version"
+     */
+    public long getVersion() {
+        return _version;
+    }
+
+    public void setVersion(long version) {
+        _version = version;
+    }
+
+    public String getState_() {
+        return _state;
+    }
+
+    public void setState_(String state) {
+        _state = state;
+    }
+
+    public QName getPID() {
+        return QName.valueOf(getPID_());
+    }
+
+    public void setPID(QName pid) {
+        setPID_(pid.toString());
+    }
+
+    public void setState(ProcessState state) {
+        setState_(state.toString());
+    }
+
+    public void setProperty(QName name, String content) {
+        ProcessConfPropertyDaoImpl prop = new ProcessConfPropertyDaoImpl();
+        prop.setKey(name.toString());
+        prop.setValue(content);
+        getEM().persist(prop);
+        _properties.put(name.toString(),prop);
+        getEM().persist(this);
+    }
+
+    public void delete() {
+        super.delete();
+    }
+
+    public QName getType() {
+        return QName.valueOf(getType_());
+    }
+
+    public void setType(QName type) {
+        setType_(type.toString());
+    }
+
+    public ProcessState getState() {
+        return ProcessState.valueOf(getState_());
+    }
+
+    public String getProperty(QName name) {
+        return _properties.get(name.toString()).getValue();
+    }
+
+    public Collection<QName> getPropertyNames() {
+        return CollectionsX.transform(new ArrayList<QName>(), _properties.keySet(),new UnaryFunction<String,QName>() {
+            public QName apply(String x) {
+                return QName.valueOf(x);
+            }
+
+        });
+    }
+
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfPropertyDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfPropertyDaoImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfPropertyDaoImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/ProcessConfPropertyDaoImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="STORE_PROCESS_PROP")
+public class ProcessConfPropertyDaoImpl {
+	
+	@Id @Column(name="ID")
+	@GeneratedValue
+	private Long _id;
+	
+    @Basic @Column(name="PROP_KEY")
+    private String _key;
+    @Basic @Column(name="PROP_VAL")
+    private String _value;
+
+    public String getKey() {
+        return _key;
+    }
+
+    public void setKey(String key) {
+        _key = key;
+    }
+
+    public String getValue() {
+        return _value;
+    }
+
+    public void setValue(String value) {
+        _value = value;
+    }
+
+	public Long getId() {
+		return _id;
+	}
+
+	public void setId(Long id) {
+		this._id = id;
+	}
+    
+    
+}

Added: ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/VersionTrackerDAOImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/VersionTrackerDAOImpl.java?rev=986561&view=auto
==============================================================================
--- ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/VersionTrackerDAOImpl.java (added)
+++ ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/store/VersionTrackerDAOImpl.java Wed Aug 18 04:12:49 2010
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.dao.jpa.store;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+@Entity
+@Table(name="STORE_VERSIONS")
+public class VersionTrackerDAOImpl {
+	
+	@Id @Column(name="ID")
+	@GeneratedValue
+	private Long _id;
+	
+    @Basic @Column(name="VERSION")
+    private long _version;
+
+    public long getVersion() {
+        return _version;
+    }
+
+    public void setVersion(long version) {
+        _version = version;
+    }
+
+	public Long getId() {
+		return _id;
+	}
+
+	public void setId(Long id) {
+		this._id = id;
+	}
+    
+}

Modified: ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml (original)
+++ ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml Wed Aug 18 04:12:49 2010
@@ -20,27 +20,29 @@
 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              version="1.0">
-    <persistence-unit name="ode-dao">
-        <!--
-            This properties file is used specifically by the
-            OpenJPA Enhancer.
-         -->
-        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
-        <class>org.apache.ode.dao.jpa.ActivityRecoveryDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.CorrelationSetDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.CorrelatorDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.EventDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.FaultDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.MessageDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.MessageExchangeDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.MessageRouteDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
-        <class>org.apache.ode.dao.jpa.CorrSetProperty</class>
-        <class>org.apache.ode.dao.jpa.MexProperty</class>
-        <class>org.apache.ode.dao.jpa.XmlDataProperty</class>
+    <persistence-unit name="ode-bpel" transaction-type="JTA">
+        <class>org.apache.ode.dao.jpa.bpel.ActivityRecoveryDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.CorrelationSetDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.CorrelatorDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.EventDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.FaultDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.MessageDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.MessageExchangeDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.MessageRouteDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.PartnerLinkDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.ProcessDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.ProcessInstanceDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.ScopeDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.XmlDataDAOImpl</class>
+        <class>org.apache.ode.dao.jpa.bpel.CorrSetProperty</class>
+        <class>org.apache.ode.dao.jpa.bpel.MexProperty</class>
+        <class>org.apache.ode.dao.jpa.bpel.XmlDataProperty</class>
     </persistence-unit>
+    <persistence-unit name="ode-store" transaction-type="JTA">
+	    <class>org.apache.ode.dao.jpa.store.ProcessConfDaoImpl</class>
+	    <class>org.apache.ode.dao.jpa.store.ProcessConfPropertyDaoImpl</class>
+	    <class>org.apache.ode.dao.jpa.store.DeploymentUnitDaoImpl</class>
+	    <class>org.apache.ode.dao.jpa.store.VersionTrackerDAOImpl</class>
+    </persistence-unit>
+    
 </persistence>
\ No newline at end of file

Modified: ode/trunk/jbi/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/pom.xml?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/jbi/pom.xml (original)
+++ ode/trunk/jbi/pom.xml Wed Aug 18 04:12:49 2010
@@ -129,8 +129,8 @@
                <artifactId>hibernate-core</artifactId>
              </exclusion>
              <exclusion>
-               <groupId>hsqldb</groupId>
-               <artifactId>hsqldb</artifactId>
+               <groupId>com.h2database</groupId>
+               <artifactId>h2</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
@@ -230,7 +230,7 @@
         </dependency>
         <dependency>
           <groupId>org.hibernate</groupId>
-          <artifactId>hibernate</artifactId>
+          <artifactId>hibernate-core</artifactId>
           <scope>provided</scope>
         </dependency>
         <dependency>
@@ -379,6 +379,11 @@
           <groupId>org.apache.geronimo.specs</groupId>
           <artifactId>geronimo-ejb_2.1_spec</artifactId>
        </dependency>
+       
+        <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
 
        <!-- This is a way to specify the global exclusion in the dependency tree -->
        <dependency>

Modified: ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java (original)
+++ ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java Wed Aug 18 04:12:49 2010
@@ -40,7 +40,6 @@ import javax.xml.namespace.QName;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.agents.memory.SizingAgent;
-import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
 import org.apache.ode.bpel.engine.BpelServerImpl;
 import org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl;
 import org.apache.ode.bpel.iapi.Endpoint;
@@ -51,6 +50,8 @@ import org.apache.ode.bpel.o.OProcess;
 import org.apache.ode.bpel.o.Serializer;
 import org.apache.ode.bpel.pmapi.InstanceManagement;
 import org.apache.ode.bpel.pmapi.ProcessManagement;
+import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
+import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
 import org.apache.ode.jbi.msgmap.Mapper;
 import org.apache.ode.jbi.util.WSDLFlattener;
 import org.apache.ode.scheduler.simple.SimpleScheduler;
@@ -99,6 +100,8 @@ final public class OdeContext {
     ExecutorService _executorService;
 
     BpelDAOConnectionFactory _daocf;
+    
+    ConfStoreDAOConnectionFactory _cdaocf;
 
     OdeConfigProperties _config;
 

Modified: ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java (original)
+++ ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java Wed Aug 18 04:12:49 2010
@@ -34,13 +34,13 @@ import javax.transaction.TransactionMana
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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.dao.bpel.BpelDAOConnectionFactory;
+import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
 import org.apache.ode.il.dbutil.Database;
 import org.apache.ode.il.dbutil.DatabaseConfigException;
 import org.apache.ode.jbi.msgmap.Mapper;
@@ -234,7 +234,7 @@ public class OdeLifeCycle implements Com
         _ode._scheduler.setExecutorService(_ode._executorService);
         _ode._scheduler.setTransactionManager((TransactionManager) _ode.getContext().getTransactionManager());
 
-        _ode._store = new ProcessStoreImpl(_ode._eprContext , _ode._dataSource, _ode._config.getDAOConnectionFactory(), _ode._config, false);
+        _ode._store = new ProcessStoreImpl(_ode._eprContext , _ode.getTransactionManager(), _ode._cdaocf);
         registerExternalVariableModules();
         _ode._store.loadAll();
 
@@ -264,14 +264,17 @@ public class OdeLifeCycle implements Com
      * @throws JBIException
      */
     private void initDao() throws JBIException {
-        BpelDAOConnectionFactoryJDBC cf;
+    	BpelDAOConnectionFactory bcf;
+        ConfStoreDAOConnectionFactory ccf;
         try {
-            cf = _db.createDaoCF();
+            bcf = _db.createDaoCF();
+            ccf = _db.createDaoStoreCF();
         } catch (DatabaseConfigException e) {
             String errmsg = __msgs.msgDAOInstantiationFailed(_ode._config.getDAOConnectionFactory());
             throw new JBIException(errmsg,e);
         }
-        _ode._daocf = cf;
+        _ode._daocf = bcf;
+        _ode._cdaocf = ccf;
     }
 
     private void initConnector() throws JBIException {

Modified: ode/trunk/jbi/src/test/jbi/ode-jbi.properties
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/test/jbi/ode-jbi.properties?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/jbi/src/test/jbi/ode-jbi.properties (original)
+++ ode/trunk/jbi/src/test/jbi/ode-jbi.properties Wed Aug 18 04:12:49 2010
@@ -62,7 +62,8 @@ ode-jbi.db.ext.dataSource=java:comp/env/
 
 # DAO Connection Factory class.
 # uncomment the following for hibernate.
-ode-jbi.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl
+ode-jbi.dao.factory=org.apache.ode.dao.hib.bpel.BpelDAOConnectionFactoryImpl
+ode-jbi.dao.factory.store=org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl
 
 # Class name of the message mapper that should be used to convert message
 # between ODE / NMS.

Modified: ode/trunk/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/pom.xml?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/pom.xml (original)
+++ ode/trunk/pom.xml Wed Aug 18 04:12:49 2010
@@ -89,7 +89,8 @@
         <wsdl4j.version>1.6.2</wsdl4j.version>
         <woodstox.version>3.2.4</woodstox.version>
         <javax.mail.version>1.4</javax.mail.version>
-        <hibernate.version>3.2.5.ga</hibernate.version>
+        <hibernate.version>3.3.2.GA</hibernate.version>
+        <hibernate.entitymanager.version>3.4.0.GA</hibernate.entitymanager.version>
         <spring.version>2.5.6</spring.version>
         <geronimo.specs.version>1.0</geronimo.specs.version>
         <geronimo.version>2.0.1</geronimo.version>
@@ -126,7 +127,8 @@
         <xml-apis.version>1.3.04</xml-apis.version>
         <servicemix.nmr.version>1.1.0-SNAPSHOT</servicemix.nmr.version>
         <axis2.transport.version>1.0.0</axis2.transport.version>
-		<h2.version>1.1.117</h2.version>
+	<javassist.version>3.9.0.GA</javassist.version>
+        <h2.version>1.1.117</h2.version>
     </properties>
 
     <modules>
@@ -148,6 +150,9 @@
         <module>bpel-ql</module>
         <module>dao-hibernate</module>
         <module>tools</module>
+        <module>dao-jpa-hibernate</module>
+        <module>dao-jpa-ojpa</module>
+        <module>dao-jpa-db</module>
         <module>bpel-store</module>
         <module>dao-jpa-ojpa-derby</module>
         <module>dao-hibernate-db</module>
@@ -436,11 +441,27 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.ode</groupId>
+                <artifactId>ode-dao-jpa-hibernate</artifactId>
+                <version>${ode.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.ode</groupId>
+                <artifactId>ode-dao-jpa-ojpa</artifactId>
+                <version>${ode.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.ode</groupId>
                 <artifactId>ode-dao-jpa</artifactId>
                 <version>${ode.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.apache.ode</groupId>
+                <artifactId>ode-dao-jpa</artifactId>
+                <version>${ode.version}</version>
+                <classifier>openjpa</classifier>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.ode</groupId>
                 <artifactId>ode-jca-ra</artifactId>
                 <version>${ode.version}</version>
             </dependency>
@@ -501,6 +522,11 @@
                 <version>${annogen.version}</version>
             </dependency>
             <dependency>
+                <groupId>javassist</groupId>
+                <artifactId>javassist</artifactId>
+                <version>${javassist.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>antlr</groupId>
                 <artifactId>antlr</artifactId>
                 <version>${antlr.version}</version>
@@ -747,16 +773,25 @@
 
             <dependency>
                 <groupId>org.hibernate</groupId>
-                <artifactId>hibernate</artifactId>
+                <artifactId>hibernate-core</artifactId>
                 <version>${hibernate.version}</version>
-                <!--
                 <exclusions>
                     <exclusion>
                         <artifactId>jta</artifactId>
                         <groupId>javax.transaction</groupId>
                     </exclusion>
                 </exclusions>
-                -->
+            </dependency>
+            <dependency>
+                <groupId>org.hibernate</groupId>
+                <artifactId>hibernate-entitymanager</artifactId>
+                <version>${hibernate.entitymanager.version}</version>
+                <exclusions>
+                    <exclusion>
+                        <artifactId>jta</artifactId>
+                        <groupId>javax.transaction</groupId>
+                    </exclusion>
+                </exclusions>
             </dependency>
 
             <dependency>
@@ -851,9 +886,9 @@
                 <version>${derby.version}</version>
             </dependency>
             <dependency>
-                <groupId>hsqldb</groupId>
-                <artifactId>hsqldb</artifactId>
-                <version>${hsqldb.version}</version>
+                <groupId>com.h2database</groupId>
+                <artifactId>h2</artifactId>
+                <version>${h2.version}</version>
             </dependency>
 
             <dependency>

Modified: ode/trunk/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/SimpleScheduler.java
URL: http://svn.apache.org/viewvc/ode/trunk/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/SimpleScheduler.java?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/SimpleScheduler.java (original)
+++ ode/trunk/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/SimpleScheduler.java Wed Aug 18 04:12:49 2010
@@ -294,6 +294,7 @@ public class SimpleScheduler implements 
                         }
                     } else {
                         if (__log.isDebugEnabled()) __log.debug("Rollbacking on " + txm + "...");
+                        ex.printStackTrace();
                         txm.rollback();
                     }
 

Modified: ode/trunk/scheduler-simple/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/ode/trunk/scheduler-simple/src/test/resources/log4j.properties?rev=986561&r1=986560&r2=986561&view=diff
==============================================================================
--- ode/trunk/scheduler-simple/src/test/resources/log4j.properties (original)
+++ ode/trunk/scheduler-simple/src/test/resources/log4j.properties Wed Aug 18 04:12:49 2010
@@ -20,7 +20,7 @@ log4j.rootLogger=WARN, CONSOLE
 
 # log4j properties to work with commandline tools.
 log4j.category.org.apache.ode.scheduler.simple.RetriesTest=DEBUG
-log4j.category.org.apache.ode.bpel.engine=INFO
+log4j.category.org.apache.ode=DEBUG
 
 # Console appender
 log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender