Closed spring-projects-issues closed 16 years ago
Takayuki Kaneko commented
It will be the best solution that database manage the synchronized seaquence. HSQLDB has sequence, maybe.
Juergen Hoeller commented
Actually, the correct solution for this would be to synchronize at the database level: that is, to lock the row while reading and updating it. This could be achieved by a REQUIRES_NEW transaction for the getNextId operation. We'll update the sample accordingly.
Juergen
Juergen Hoeller commented
Actually, this is not quite trivial to solve in a general fashion, given the custom id generation mechanism that JPetStore uses there. So for the sake of simplicity, we'll simply leave the sample as-is (which is equivalent to what the original iBATIS JPetStore did the).
Juergen
Takayuki Kaneko opened SPR-1759 and commented
SqlMapSequenceDao#getNextId must be synchronized because this method need to be protected from concurrency.
I suggest followings.
Regards,
Affects: 1.2.7