mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 03:53:07 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user