HibGraphFactory static field checkTypes has side effects

1 view
Skip to first unread message

Cheong Chung Onn

unread,
Aug 2, 2009, 3:59:31 AM8/2/09
to sarasvat...@googlegroups.com
Hi Paul,

I am puzzled why my test cases used to work until now - i.e. all fails
except the first. And when I run them separately it all works... After
many hours chasing around, I managed to nailed the bug by
HibGraphFactory static field checkTypes. This nasty bug will not surface
under normal usage however it would when it is used in running multiple
sarasvati test-cases in a single run.

Assuming i have 2 sarasvati testcases to be run in a single pass, the
first testcase will pass however the second testcase will fail. This is
because in the second testcase the HibGraphFactory.checkTypes is already
initialized by the first test case and this is not in-sync with the
database as all the tables have already been dropped.

This easiest fix is to allow a new api like
HibGraphFactory#resetCheckTypes. What do you think?

Regards
chung-onn

Paul Lorenz

unread,
Aug 2, 2009, 11:45:57 AM8/2/09
to sarasvat...@googlegroups.com
I just took out the checked types. It was probably an unnecessary optimization, since you only need to add node types when using the loader. During normal operation, hibernate takes care of the node types. I actually ran into this earlier, when I had an error during load and the insert got rolled back.

cheers,
Paul
Reply all
Reply to author
Forward
0 new messages