Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<blueprints.version>2.6.0</blueprints.version>
<glassfish.version>4.1</glassfish.version>
<logback.version>1.0.4</logback.version>
<orientdb.version>2.0.1</orientdb.version>
<orientdb.version>2.0.13</orientdb.version>
<slf4j.version>1.6.6</slf4j.version>
<spring.version>4.1.4.RELEASE</spring.version>
<wildfly.version>8.2.0.Final</wildfly.version>
Expand Down