Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSQLException: ERROR: Operation only supported in SERIALIZABLEisolation level #1647

Closed
intellectcubed opened this issue Jun 28, 2019 · 4 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) community/request Issues created by external users kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@intellectcubed
Copy link

intellectcubed commented Jun 28, 2019

Jira Link: DB-1407
YugabyteStackTrace.txt

Getting the attached stack trace warning me about the "Operation only supported in SERIALIZABLEisolation level". The stack trace actually refers to a current issue, but I'm not clear what the problem is, nor how to resolve it. My code works fine when pointing to Postgresql, but when I change to Yugabyte, I get the exception.

More info:
I am using straight hibernate from Java. A schema and tables are auto created, but when I try to insert into that table, I get this exception.

Here is a code snippet:

    Session session = openCurrentSession();
    Transaction transaction = session.beginTransaction();
    try {
        session.save(entity);
        transaction.commit();
    } catch(RuntimeException rte) {
        transaction.rollback();
    }
    session.close();
@kmuthukk
Copy link
Collaborator

Like related to #1199

Does the table have FK constraints?

@kmuthukk kmuthukk added the area/ysql Yugabyte SQL (YSQL) label Jun 28, 2019
@intellectcubed
Copy link
Author

intellectcubed commented Jun 28, 2019 via email

@yugabyte-ci yugabyte-ci added the community/request Issues created by external users label Jul 17, 2019
@ndeodhar
Copy link
Contributor

@intellectcubed This is most likely because hibernate is using foreign keys / triggers under the hood. Can you try doing this?:

  1. Update postgresql.conf file located in $yugabyte_data_dir/node-1/disk-1/pg_data/ folder and add the line default_transaction_isolation='serializable'.
  2. Do step (1) on all nodes where you've installed YB and then restart yb-tserver process on those nodes. Note that if you're using local setup, you can restart using ./bin/yb-ctl restart.

Now, you should not see the error while running your app.

@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@sushantrmishra
Copy link

@intellectcubed . Please try out the suggestion in #1647 (comment) and reopen the issue if still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) community/request Issues created by external users kind/bug This issue is a bug priority/medium Medium priority issue
Projects
Status: Done
Development

No branches or pull requests

6 participants