Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:21:42+00:00 2026-05-27T17:21:42+00:00

We are using Grails [Spring+Hibernate] and have one service method with @Transactional(readOnly=true). During development

  • 0

We are using Grails [Spring+Hibernate] and have one service method with @Transactional(readOnly=true). During development & tests we were using HSQLDB and the behaviour was such that we could use .save(flush:true) and object would be saved to the database, but all other objects would be rolled back.
Everything was great accept for when we switched to Postgres. Now this settings throws back:
ERROR – transaction is read only.

EDIT:

We have to be able to rollback all the data in the transaction but still be able to save the data we require to be saved [some additional stuff, not related to the transaction, like something for logging purposes]. It don’t want to use any DB triggers to do that. We also don’t want to get Stale Object Exceptions when saving stuff after the original request was served.
Any ideas on how we could achieve that? The only thing that comes to my mind is to have some kind a registry where we would store references to modified objects and at the end drop all changes, but this is the last resort. I am sure there’s a way to tackle this issue without doing stupid things.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:21:43+00:00Added an answer on May 27, 2026 at 5:21 pm

    so we’ve found the solution.
    It’s in grails jira:

    http://jira.grails.org/browse/GRAILS-8513?focusedCommentId=68436&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-68436

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're developing an app (using Grails Spring Security (formerly Acegi)) in which we'll have
I'm using Spring Security in Grails to restrict access to my controllers. I have
I have a Grails project that is using Hibernate XML. The Hibernate file are
We are using grails-groovy with Hibernate, I have a SQL query like this in
I have integrated spring security plugin with my grails application, which has hibernate as
I'm using grails with spring security and the JA-SIG CAS spring security plugin. One
I have just started using grails and installed the spring-security and spring-security-ui plugins. I
I am using Grails multi-tenant plugin with single-tenant mode. I have used spring security
I'm considering using Grails for my current project. I have a couple of requirements
I have been updating all my services to be transactional by using Grail's ability

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.