Giter VIP home page Giter VIP logo

gorm-redis's Introduction

gorm-redis's People

Contributors

graemerocher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gorm-redis's Issues

grails v3.3.2 does not apply to the current version (redis-gorm)

gradle3.5
dependencies {
compile 'org.grails.plugins:redis-gorm:6.0.4'
}

domain
class Person {
String firstName
String lastName
static constraints = {
firstName blank:false
lastName blank:false
}
static mapWith = "redis"
static mapping = {
lastName index:true
}

problem:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileGroovy'.

org.grails.datastore.gorm.redis.RedisEntityTraitProvider.isAvailable()Z

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Error |
    Failed to start server (Use --stacktrace to see the full trace)

ClassNotFound Exception when using hibernate with gorm-redis

When i run my application to monitor a particular domain i get a
Caused by: java.lang.ClassNotFoundException: org.grails.datastore.gorm.bean.factory.AbstractMappingContextFactoryBean at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
My domain

class Book {
    Long id
    String title
    Date releaseDate

    static constraints = {
    }
    static mapping = {
        title index:true
    }

    static mapWith = "redis"
}

My application.yml

        host: "localhost"
        port: 6379
#        password: "secret"
        pooled: true
        resources: 15
        timeout: 5000

This issue occures both on the
implementation 'org.grails.plugins:redis-gorm:5.0.13'
and
implementation 'org.grails.plugins:redis-gorm:6.0.4'

Initial save() require manual flush to write to the database

Reproduced with a sample application.

When I create a new GORM instance and call save(), the expected behavior is for the data to be written when the session is flushed automatically.

What appears to be happening is that the insert never happens completely, though redis-cli monitor prints

1490915589.935292 [0 127.0.0.1:49638] "INCR" "gorm.redis.test.Book.next_id"

When I change it to save(flush: true), the data persists as expected.

While I understand 100% GORM-hibernate compatibility is not the goal, I would expect that calling save() would still allow the underlying implementation to handle flushing the session for me.

Example project:
https://github.com/joemccall86/gorm-redis-test

Instructions: Run the grails app, and use cURL according to the following examples:

# Using hibernate
[~/code/gorm-redis-test]$ curl http://localhost:8080/book/save
saved%
[~/code/gorm-redis-test]$ curl http://localhost:8080/book/index
Author: John Doe, Pages: 300
1 books total
# Using mapWith="redis"
[~/code/gorm-redis-test]$ curl http://localhost:8080/book/save
saved%
[~/code/gorm-redis-test]$ curl http://localhost:8080/book/index
0 books total

Tested with "org.grails.plugins:redis-gorm:6.0.4" and gormVersion=6.1.0.RELEASE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.