AW: persistent service: default data
"Vidakovic Aleksandar" <[email protected]>
| Newsgroups | gmane.comp.java.keel.devel |
|---|---|
| Message-ID | <[email protected]> |
Pierre, I had the same problem when I started with keel. There is no special order of record insertion... and there is the problem. With your configuration you need the table "ids" WITH some entries, but it seems that those entries are inserted after YOUR default data... so keel tries to put your data into the database and requests an id from the "ids" table, but there are no entries yet, so you can't get an id and therefor you get the error. Cheers, Aleks -----Ursprüngliche Nachricht----- Von: Raoul Pierre [mailto:[email protected]] Gesendet: Dienstag, 15. Februar 2005 10:12 An: developers-6VIttnCrOeJXNEnpj1eHPNi2O/[email protected] Betreff: [Keelgroup] persistent service: default data Hello, with hsqldb (I didn't try with other RDBS), when some default data are specified, as /** * Payroll Worker * * @persist.persistent * schema="payroll" * name="worker" * descrip="Persistent worker" * table="worker" * * @persist.record * workerId="1" * lastname="This is the first record" * @persist.record * workerId="2" * lastname="This is the second record" */ then with the request model.do?model=createdb I get: - with the browser Unable to create database tables:Persistence exception while creating default data for 'payroll.worker', adding factory:default,name:payroll.worker,table_name:T_worker,field_values:workerId=1 - in Tomcat log Caused by: org.keel.services.persist.PersistenceException: $keelFieldNoAutoInc|Worker record IdUnable to allocate a block of Ids., Table not found: IDS in statement [SELECT next_id FROM ids] But if I remove the default data, then call the above request, there is no problem. And if after that, I keep the hsql files, put again the default data, rebuild the application and call the above request, then everything is fine: the records are created in the database. It seems that the IDS table isn't still created when Keel tries the first time to create the default data records. Pierre http://keelframework.org/documentation.shtml Keelgroup mailing list [email protected] http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com http://keelframework.org/documentation.shtml Keelgroup mailing list [email protected] http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com