DBUnit, HSQLDB, Postgre... Sequence problems...

73 views
Skip to first unread message

onclez...@gmail.com

unread,
Mar 18, 2018, 1:46:20 PM3/18/18
to Sculptor Generator
Hi guys !

Let's explain the use case:
  • the final db is PostGRE (with may be some integration tests...)
  • So, in the model, i have something like this for entities :
    hint="idSequence=MNA2"

  • HSQLDB is used for unit tests.
  • I have some lines in dbunit xml test file with ids (1, 2, etc...)
  • Let's test a save entity... I have this p6spy log:
    call next value for MNA2
    #1521392272938 | took 3ms | statement | connection 3|call next value for MNA2
    call
    next value for MNA2;

    which is normal because of idSequence set for PostGre but... it's a unit test, so HSQLDB...
  • the insert statement finish with a
    integrity constraint violation: unique constraint or index violation; SYS_PK_10097 table
    That is normal because it try to insert a line with the same id that set in the dbunit xml test file : 1
  • When i remove idSequence from the model, it'works !! normal !!

What do you think about this ? Is there a workaround ?
Thx

pavel.tavoda

unread,
Apr 4, 2018, 11:38:38 AM4/4/18
to Sculptor Generator
What is 'start seq number' for MNA2 sequencer? Try to use IDs in your dbunit XML with 1000 not with 1.

/Pavel
Reply all
Reply to author
Forward
0 new messages