Gemfire Plugin
  1. Gemfire Plugin
  2. GPGEMFIRE-2

GORM adding to cache overlaps existing entries due to non-unique key

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      When using Grails Gemfire Plugin with GORM integration in client/server mode, adding new cache entries overwrites existing entries due to non-unique key.

      Setup is as follows:

      Multiple cacheservers with data-policy REPLICATE
      Multiple TC Servers running grails application

      Restart cacheservers to clear cache
      Start TC Servers

      Alternate between the server instances, you will see entries get overwritten.

        Activity

        Hide
        Mike Sandman added a comment -

        My team is also experiencing this issue. We are dead in the water until this is fixed or we move away from GemFire. As a corporate vFabric user with a VMWare ELA in place, I am hard pressed to move to something else like Redis and would hate to move away from a NoSQL solution. I plan to put resources on fixing this issue. I would appreciate some help/thoughts/directions from the community, especially the committers.

        Show
        Mike Sandman added a comment - My team is also experiencing this issue. We are dead in the water until this is fixed or we move away from GemFire. As a corporate vFabric user with a VMWare ELA in place, I am hard pressed to move to something else like Redis and would hate to move away from a NoSQL solution. I plan to put resources on fixing this issue. I would appreciate some help/thoughts/directions from the community, especially the committers.
        Hide
        Mike Sandman added a comment -

        I just spent some time digging through the GemFire plugin code. While it is not feature complete with regard to accounting for multiple cache servers, it is arguably working fine. The problem for us is that our code, specifically the domain classes, are using GORM's default ID generation algorithm which is creating ID values which are only locally unique. The simplest solution may be to start using a universally unique identifier (UUID), something like the following.

        class Person {
        ..
        static mapping =

        { id generator:'uuid' }

        }

        Of course, one immediate problem with this maybe that since the UUID generator is really coming from Hibernate, not GORM, this may not work out of the box. The plugin may need to contribute an ID generation algorithm to GORM. I'll update my team's findings as we make progress.

        Show
        Mike Sandman added a comment - I just spent some time digging through the GemFire plugin code. While it is not feature complete with regard to accounting for multiple cache servers, it is arguably working fine. The problem for us is that our code, specifically the domain classes, are using GORM's default ID generation algorithm which is creating ID values which are only locally unique. The simplest solution may be to start using a universally unique identifier (UUID), something like the following. class Person { .. static mapping = { id generator:'uuid' } } Of course, one immediate problem with this maybe that since the UUID generator is really coming from Hibernate, not GORM, this may not work out of the box. The plugin may need to contribute an ID generation algorithm to GORM. I'll update my team's findings as we make progress.
        Hide
        Jeff Scott Brown added a comment -

        Burt,

        Can you work with Curtis to see if we can get this working?

        Thanks!

        Show
        Jeff Scott Brown added a comment - Burt, Can you work with Curtis to see if we can get this working? Thanks!
        Hide
        Burt Beckwith added a comment -

        I implemented "id generator: 'uuid'" for Gemfire, see https://github.com/SpringSource/grails-data-mapping/commit/5e38075b7ea59f59b399e312e86576a1a664916c

        This will be available in the M7 release of the library releases, and a plugin update will be needed after that

        Show
        Burt Beckwith added a comment - I implemented "id generator: 'uuid'" for Gemfire, see https://github.com/SpringSource/grails-data-mapping/commit/5e38075b7ea59f59b399e312e86576a1a664916c This will be available in the M7 release of the library releases, and a plugin update will be needed after that

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Curtis Pope
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: