Skip to content

GPMONGODB-11: MongoDB saves in BootStrap not persisting unless explicitly set to flush:true #473

@graemerocher

Description

@graemerocher

Original Reporter: alexduan
Environment: Grails 1.3.6, MongoDB-1.0.0.M4
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPMONGODB-11

When creating objects in BootStrap.groovy, objects remain unsaved until either an explicit flush or when a read occurs.

Scenario one:

{code}
new Role(authority: "ROLE_ADMIN").save()
{code}

Results: role is not saved

Scenario two:

{code}
new Role(authority: "ROLE_ADMIN").save()
role = Role.list()
{code}

Results: role is saved

Scenario three:

{code}
new Role(authority: "ROLE_ADMIN").save(flush:true)
{code}

Results: role is saved

Does not seem to affect controllers

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions