st-tu-dresden / videoshop

SalesPoint sample application
Apache License 2.0
87 stars 246 forks source link

saving Entitys result in HSQL: right truncation #45

Closed ftolkmitt closed 8 years ago

ftolkmitt commented 9 years ago

Downgrading the hsql dependency to, e.g. 2.2.9 will fix this problem, but with the newest version 2.3.3 you have the problem described below:

Steps for reproducing: Adding a field and corresponding getter & setter, e.g. in the Disk class:

private int fsk;

Adding a request-Mapping in Catalogcontroller:

@RequestMapping(value = "/fsk", method = RequestMethod.POST)
public String comment(@RequestParam("pid") Disc disc, @RequestParam("fsk") int fsk) {
        disc.setFsk(fsk);
        videoCatalog.save(disc);
        return "redirect:detail/" + disc.getIdentifier();
}

The .save Operation will throw a org.hsqldb.HsqlException: data exception: string data, right truncation Error.

odrotbohm commented 8 years ago

I spent a bit of time on this and it seems like HSQL needs very detailed information about column sizes for BLOBs. I've tried using H2 as a replacement and that seems to work fine. So I'd suggest to switch to H2 as the embedded database. I'll change that for the Videoshop and the kickstarter project.

odrotbohm commented 8 years ago

That should be fixed by switching to H2.