Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Rest with HSQL in memory: old data after server restart Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Rest with HSQL in memory: old data after server restart

    Hi there,

    I have a strange behaviour on my system. I am running STS 3.1 and I use Spring-DATA-JPA and -REST
    My domain model is exposed perfectly via -REST.

    But: I get old data via my REST repositories after a server restart.
    It is even stranger. I have /files/
    If I try to access a file, e.g. "/files/1/", before posting a file, I don't get anything.
    But if I post a new file and then try to access the new file via the url "/files/1" I don't get the new file data. I get the data of a file which was created in one of my first runs. This happens even after several server restarts.

    I find this behaviour realy strange...
    My datasource is created via the EmbeddedDatabaseBuilder:
    Code:
    @Bean public DataSource dataSource() {
        EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
        return builder.setType(EmbeddedDatabaseType.HSQL).build();
      }
    Anyone ever experienced this?

    Does somebody have a solution?

    Thanks!
    Dominik

  • #2
    Sorry for bringing this up again, but I am still stuck with the problem.

    I hav somewhat narrowed down the problem now.

    My JpaRepository seems to work fine. At least it gives me the data of files I have created just before.
    The problem is that accessing the REST exposed objects still gives me different content when accessing:

    /files/

    and

    /files/1

    strange enough, that I get all the content of the file objects under /files/, according to the Spring Data REST documentation it should only give me the links, but, I get all the content of the all file objects which were created since the last server start.

    But when I access one of them directly e.g. /files/1 I get content of an old file object that was created in a past server run.

    Might there be some caching in spring data rest?

    Thanks!
    Dominik

    Comment

    Working...
    X