The strange thing is, that if i load the import.sql file manually, using
Derbys ij prompt, it loads without error, even in the Derby db created by
Hibernate.

I'm not Hibernate-fluent, but one thing I often encounter when designing
and testing mechanisms like this is that some import systems want/demand
a semicolon at the end of each line of SQL text in the script, whereas other
import systems can't handle the semi-colon and demand that it be omitted.

If your import.sql script has a semicolon at the end of each line, try
taking that semicolon out and see if it affects the behavior.

Or, if your import.sql script does NOT have a semicolon at the end of each
line, try adding it back in and see if that helps.

If neither solution helps, three other ideas:

1) Do you think that any part of your script is running? After the failure,
connect to your database with ij and run "show tables" and the like and see
if you can figure out how far your script got before it crashed.

2) Check your derby.log for additional messages and clues. The messages
in derby.log are often much easier to decipher than the client-side
messages which are processed by layers and layers of client-side libraries.

3) Try "binary searching" your script:
   a) remove half of the script: does the bug go away?
   b) If the bug went away, restore half of the script you removed and retry
   c) If the bug remains, remove another half of the script and retry
With even a large script, within 5 or 10 runs you'll have narrowed down the
failure to a couple lines at which point it should be obvious.

Hope this helps,

bryan

Reply via email to