Each of these "READ" endpoints should "autocommit", which prevents transaction abort issues (atleast with postgres).

If you got an error, (i.e. negative limit is bad), then PG will barf always.
current transaction is aborted, commands ignored until end of transaction block
This commit is contained in:
Peter Dietz
2013-10-18 12:50:34 -04:00
parent 87c427b903
commit 987e835e5e
5 changed files with 17 additions and 1 deletions

View File

@@ -40,6 +40,8 @@ public class BitstreamResource {
try {
if(context == null || !context.isValid()) {
context = new Context();
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
context.getDBConnection().setAutoCommit(true);
}
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);
@@ -62,6 +64,8 @@ public class BitstreamResource {
try {
if(context == null || !context.isValid() ) {
context = new org.dspace.core.Context();
//Failed SQL is ignored as a failed SQL statement, prevent: current transaction is aborted, commands ignored until end of transaction block
context.getDBConnection().setAutoCommit(true);
}
org.dspace.content.Bitstream bitstream = org.dspace.content.Bitstream.find(context, bitstream_id);