Thomas/Rob/Dusty,

Thanks for the replies and help.  I will try ordering the data as soon as I
get a chance to go back and try the H2 config again (I moved on to
experimenting with MySQL).  BTW, I hadn't created any of my own models yet,
this was the "canned" user/roles data that is created by default by using
the Maven archetype.

Shash


dusty wrote:
> 
> I have run into this problem and the ordering the data in sample-data.xml
> definitely works on the insert.  My problem is that the tables can't be
> truncated or deleted because you can't control the order when CLEAN_INSERT
> runs.  So I usually write a script that truncates/deletes the table data
> and then have it run right before the CLEAN_INSERT.
> 
> 
> 
> Rob Hills wrote:
>> 
>> Hi Thomas,
>> 
>> On 1 Oct 2007 at 9:54, Thomas Ramapuram wrote:
>> 
>>> You usually have a problem with CLEAN_INSERT if you have some kind of 
>>> recursive model.  (ie.  a table which has a relationship with itself).  
>>> I havent found any workaround this.  What I do is do not add this data 
>>> to the sample data.   The error I get is foreignKeyConstrain error.
>> 
>> The other way to fix this is to re-order your sample data.  AFAICT, the
>> data 
>> is inserted in the database in the order it appears in sample-data.xml. 
>> If you 
>> make sure that parent table data is inserted before the data in its
>> related 
>> children, your CLEAN_INSERT should run smoothly.
>> 
>> The only downside to this approach is that you need to recheck sample-
>> data.xml any time you run an appfuse:gen task as I've found that it
>> usually 
>> deletes the data for the associated DB table in sample-data.xml and adds
>> it 
>> again to the end of that file, hence potentially breaking foreign key 
>> constraints.
>> 
>> HTH,
>> Rob Hills
>> Waikiki, Western Australia
>> Mobile +61 (412) 904-357
>> Fax: +61 (8) 9529-2137
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-CLEAN_INSERT-tf4540004s2369.html#a13000090
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to