AW: AW: persistent service: default data

"Vidakovic Aleksandar" <[email protected]>
Newsgroups gmane.comp.java.keel.devel
Message-ID <[email protected]>
To fix this problem it would be necessary to influence the order of record insertion. And I think there is no immediate solution for this.

But the problem only appears if you use IDs based on the "ids" table. If you use database autoids (e. g. sequences with postgres) or UIDs (e. g. with the hibernate persistence service) you won't have this problem.

Hope this helps,

Aleks

-----Ursprüngliche Nachricht-----
Von: Raoul Pierre [mailto:[email protected]]
Gesendet: Dienstag, 15. Februar 2005 10:49
An: developers-6VIttnCrOeJXNEnpj1eHPNi2O/[email protected]
Betreff: Re: AW: [Keelgroup] persistent service: default data


Aleks,

OK, but is there any known turnaround?

Pierre



Vidakovic Aleksandar a écrit :

>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
>
>
>  
>



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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.