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

Hibernate session's flushMode set to FlushMode.MANUAL unexpectedly #46

Open
olisikh opened this issue Nov 15, 2012 · 1 comment
Open

Comments

@olisikh
Copy link

olisikh commented Nov 15, 2012

Hi, guys.

Nice plugin, very useful, thank you for it!

I had taken a look at #15 issue, and was happy to see that some issues with hibernate sessions were resolved, but it seems not all of them.

I have elasticsearch-grails-plugin up-to-date taken from your repo. When I try to save any item to database and then to remove it via my "admin UI", an exception is thrown after calling delete operation.
Here's the message:

  Message: Write operations are not allowed in read-only mode (FlushMode.MANUAL): 
  Turn your    Session into flushMode.COMMIT/AUTO or remove 'readOnly' 
  marker from transaction definition.

This error is thrown only when plugin is enabled. As a workaround, which prevents this weird exception:

  Domain.withTransaction {
      domain.delete(flush: true)
  }

But it's not pretty, is it? Appreciate any help! Is it a hibernate bug, or another plugin's session management bug?

@dongwq
Copy link

dongwq commented May 24, 2013

this is a weird phenomena. I use a Filter to set each session.setFlushMode(FlushMode.AUTO).

or do sessin.flush in filter' afterView closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants