From 19b6573e04427fecac90ac6a0c33a30a1eadcbfd Mon Sep 17 00:00:00 2001 From: "emmanuel.silva" Date: Sat, 30 May 2015 14:21:10 -0300 Subject: [PATCH 1/4] upgrade orientdb library version from 2.0.1 to 2.0.9. The version 2.0.1 was create the schema with custom type relationship between classes (one to one) instead of Link type. The version 2.0.9 the schema has sucessfully created. --- orient-ra/pom.xml | 35 +++++++++++++++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/orient-ra/pom.xml b/orient-ra/pom.xml index 75d0fee..ee4f65c 100644 --- a/orient-ra/pom.xml +++ b/orient-ra/pom.xml @@ -49,5 +49,40 @@ + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.codehaus.mojo + + + templating-maven-plugin + + + [1.0-alpha-3,) + + + filter-sources + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index b45ee70..a5cf83c 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 2.6.0 4.1 1.0.4 - 2.0.1 + 2.0.9 1.6.6 4.1.4.RELEASE 8.2.0.Final From ffb4b265cc5efac805460b840ca378ebed732cd0 Mon Sep 17 00:00:00 2001 From: mikuger Date: Thu, 6 Aug 2015 15:36:48 +0200 Subject: [PATCH 2/4] fix for behavior, where sometimes a transaction begin on a closed connection was tried. --- .../impl/OrientManagedConnectionImpl.java | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/orient-ra/src/main/java/org/ops4j/orient/adapter/impl/OrientManagedConnectionImpl.java b/orient-ra/src/main/java/org/ops4j/orient/adapter/impl/OrientManagedConnectionImpl.java index 6ed1e7a..fc0b9ac 100644 --- a/orient-ra/src/main/java/org/ops4j/orient/adapter/impl/OrientManagedConnectionImpl.java +++ b/orient-ra/src/main/java/org/ops4j/orient/adapter/impl/OrientManagedConnectionImpl.java @@ -66,23 +66,39 @@ class OrientLocalTransaction implements LocalTransaction { @Override public void begin() throws ResourceException { - log.debug("begin()"); - db.begin(); - fireConnectionEvent(LOCAL_TRANSACTION_STARTED); + try { + log.debug("begin()"); + if (db.isClosed()) { + log.debug("db connection closed, reopening..."); + openDatabase(); + } + db.begin(); + fireConnectionEvent(LOCAL_TRANSACTION_STARTED); + } catch (RuntimeException e) { + throw new ResourceException(e); + } } @Override public void commit() throws ResourceException { - log.debug("commit()"); - db.commit(); - fireConnectionEvent(LOCAL_TRANSACTION_COMMITTED); + try { + log.debug("commit()"); + db.commit(); + fireConnectionEvent(LOCAL_TRANSACTION_COMMITTED); + } catch (RuntimeException e) { + throw new ResourceException(e); + } } @Override public void rollback() throws ResourceException { - log.debug("rollback()"); - db.rollback(); - fireConnectionEvent(LOCAL_TRANSACTION_ROLLEDBACK); + try { + log.debug("rollback()"); + db.rollback(); + fireConnectionEvent(LOCAL_TRANSACTION_ROLLEDBACK); + } catch (RuntimeException e) { + throw new ResourceException(e); + } } } @@ -112,11 +128,11 @@ private void createDatabaseHandle() { log.debug("instantiating Orient Database of type [{}] with URL [{}]", type, url); if (type.equals("document")) { - this.db = new ODatabaseDocumentTx(url); + this.db = new ODatabaseDocumentTx(url, true); } else if (type.equals("object")) { this.db = new OObjectDatabaseTx(url); } else if (type.equals("graph")) { - this.db = new ODatabaseDocumentTx(url); + this.db = new ODatabaseDocumentTx(url, true); } } From 5fc414ddc800103776e391c16256ff29c9354038 Mon Sep 17 00:00:00 2001 From: mikuger Date: Thu, 6 Aug 2015 15:44:34 +0200 Subject: [PATCH 3/4] update to orient db version 2.0.13 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a5cf83c..738a9bd 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 2.6.0 4.1 1.0.4 - 2.0.9 + 2.0.13 1.6.6 4.1.4.RELEASE 8.2.0.Final From 70465860813934a7901e93cb697e57b6e7331404 Mon Sep 17 00:00:00 2001 From: mikuger Date: Thu, 6 Aug 2015 15:50:56 +0200 Subject: [PATCH 4/4] eclipse plugin config removed. --- orient-ra/pom.xml | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/orient-ra/pom.xml b/orient-ra/pom.xml index ee4f65c..75d0fee 100644 --- a/orient-ra/pom.xml +++ b/orient-ra/pom.xml @@ -49,40 +49,5 @@ - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.codehaus.mojo - - - templating-maven-plugin - - - [1.0-alpha-3,) - - - filter-sources - - - - - - - - - - - - \ No newline at end of file