Hallo ich möchte pesssimistisches Locking verwenden jedoch bekomme ich wenn ich mein Interface annotiere folgende Fehlermeldung
Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT "begriff"."id" AS "id", "begriff"."name" AS "name" FROM "begriff" WHERE "begriff"."id" = ? FOR UPDATE OF "begriff"]; SQL state [25006]; error code [0]; ERROR: cannot execute SELECT FOR UPDATE in a read-only transaction; nested exception is org.postgresql.util.PSQLException:
Wieso wird daraus eine read only transaction? kann mir jemand helfen ?
Java:
public interface SpringDataGlossarRepository extends CrudRepository<Begriff, Integer> {
List<Begriff> findAll();
@Lock(LockMode.PESSIMISTIC_WRITE)
Optional<Begriff> findById(int id);
}
Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT "begriff"."id" AS "id", "begriff"."name" AS "name" FROM "begriff" WHERE "begriff"."id" = ? FOR UPDATE OF "begriff"]; SQL state [25006]; error code [0]; ERROR: cannot execute SELECT FOR UPDATE in a read-only transaction; nested exception is org.postgresql.util.PSQLException:
Wieso wird daraus eine read only transaction? kann mir jemand helfen ?