Skip to content

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

Description

@olisikh

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions