简体   繁体   中英

Best version of the mongodb gorm plugin for grails 2.2.x?

Will the current MongoDB GORM plugin work on grails 2.2.x versions ? Specifically grails 2.2.3. Just a note, upgrading to grails 2.3 is really not an easy option for this app.

After a few tests, the last version of the mongodb Grails plugin compatible with Grails 2.2.x (2.2.4 in my case) seems to be 1.3.3.

Trying to use the version after (2.0.0) gives the following:

Plugin mongodb-2.0.0 requires version [2.3.2 > *] of Grails which your current Grails installation does not meet

You can use the latest one: 3.0.1

This version has support for mongodb 2.6

After experimenting with various combinations. I have found that it's the 1.3.3 version of mongodb that worked for my grails version 2.2.3.

additional notes:

I also had to use the 1.1.9 versions grails-datastore-core and grails-datastore-simple as the 1.1.8 versions were causing a class def not found for StatelessDatastore.

I use maven for my build so the final dependencies I added look like this:

<dependency>
    <groupId>org.grails.plugins</groupId>
    <artifactId>mongodb</artifactId>
    <version>1.3.3</version>
    <scope>compile</scope>
    <type>zip</type>
</dependency>

<dependency>
    <groupId>org.grails</groupId>
    <artifactId>grails-datastore-core</artifactId>
    <version>1.1.9.RELEASE</version>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>org.grails</groupId>
    <artifactId>grails-datastore-simple</artifactId>
    <version>1.1.9.RELEASE</version>
    <scope>compile</scope>
</dependency>

Thanks for the replies everyone.

watch out!

mongo 3.0.1 uses updated version of gorm/hibernate libs, which are incompatible with the ones delivered with hibernate:3.6.10.13 (the most recent version is 3.6.10.14, but when I try getting it, the dependency couldn't be resolved). That means, that the libs in the older versions of hibernate plugin can not be newer than that.

see or in namedQueries in Grails 2.3.8: AbstractMethodError for details.

I had to switch from 3.0.1 back to 3.0.0. If you want to upgrade you mongo java driver, you can do it via dependencies w/o upgrading the grails plugin. Heck! I even used aggregation in mongodb:1.0.0.RC3 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM