Commit 1a6b6a74 authored by Matyáš Latner's avatar Matyáš Latner

#5 ControlServer Postgre 9.3 compatibility fix

parent a920bd15
......@@ -83,7 +83,7 @@ public class ContextListener implements ServletContextListener
psUpd.close();
ps.close();
conn.commit();
conn.setAutoCommit(true);
}
catch (Exception e)
{
......
......@@ -238,8 +238,9 @@ public class QualityOfServiceResultResource extends ServerResource
}
else
errorList.addError("ERROR_TEST_TOKEN_MISSING");
conn.commit();
conn.setAutoCommit(true);
}
else
errorList.addError("ERROR_DB_CONNECTION");
......@@ -256,6 +257,7 @@ public class QualityOfServiceResultResource extends ServerResource
//System.out.println("Error while storing data " + e.toString());
e.printStackTrace();
}
else
errorList.addErrorString("Expected request is missing.");
......@@ -267,7 +269,7 @@ public class QualityOfServiceResultResource extends ServerResource
{
System.out.println("Error saving ErrorList: " + e.toString());
}
return answer.toString();
}
......
......@@ -290,7 +290,6 @@ public class RegistrationResource extends ServerResource
if (errorList.getLength() == 0)
try
{
PreparedStatement st;
st = conn
.prepareStatement(
......@@ -300,9 +299,9 @@ public class RegistrationResource extends ServerResource
int i = 1;
// uuid
st.setObject(i++, UUID.fromString(testUuid));
st.setObject(i++, UUID.fromString(testUuid), Types.OTHER);
// open_test_uuid
st.setObject(i++, UUID.fromString(testOpenUuid));
st.setObject(i++, UUID.fromString(testOpenUuid), Types.OTHER);
// client_id
st.setLong(i++, clientUid);
// client_name
......
......@@ -497,8 +497,9 @@ public class ResultResource extends ServerResource
}
else
errorList.addError("ERROR_TEST_TOKEN_MISSING");
conn.commit();
conn.setAutoCommit(true);
}
else
errorList.addError("ERROR_DB_CONNECTION");
......
......@@ -19,6 +19,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.UUID;
import at.alladin.rmbt.db.fields.BooleanField;
......@@ -221,7 +222,7 @@ public class Test extends Table
try
{
final PreparedStatement st = conn.prepareStatement(SELECT + " WHERE t.deleted = false AND t.implausible = false AND t.uuid = ?");
st.setObject(1, uuid);
st.setObject(1, uuid, Types.OTHER);
loadTest(st);
......@@ -240,7 +241,7 @@ public class Test extends Table
try
{
final PreparedStatement st = conn.prepareStatement(SELECT + " WHERE t.deleted = false AND t.implausible = false AND t.open_test_uuid = ?");
st.setObject(1, openTestUuid);
st.setObject(1, openTestUuid, Types.OTHER);
loadTest(st);
......
......@@ -53,7 +53,7 @@ public class UUIDField extends FieldAdapter<UUID>
if (value == null)
ps.setNull(idx, Types.OTHER);
else
ps.setObject(idx, value);
ps.setObject(idx, value, Types.OTHER);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment