cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: "Can't extract a master key" error
Date Thu, 17 Nov 2011 18:12:26 GMT
Hi Bruno,

The last time I saw this problem we had cyclic tables.  Something like:

Table A -> Table B -> Table C -> Table D -> Table A

Given this situation, Cayenne isn't able to properly do the inserts.
I *believe* this only applies to using autogenerated keys (are you
using MySQL?), though.

mrg


On Thu, Nov 17, 2011 at 11:24 AM, Bruno René Santos <brunorene@holos.pt> wrote:
> Hello all,
>
> I am getting this error on my application:
>
> org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Aug 25 2010 19:38:17]
> Can't extract a master key. Missing key (id), master ID
> (<ObjectId:Avaliacao, TEMP:00000C43DB4942B7>)
>
> I can see on the logs that Cayenne is trying to insert an object that needs
> a foreign key from another object that was not inserted yet... A past post
> suggested that this could be a problem on the Model Map but we already made
> it from scratch so we do not think that problem is there. My application
> tries to clone a whole set of object into a new set objects (like creating
> a complex structure from a template) and leaving a relationship of object
> -> template between all objects that are part of the structure...
>
> Any one knows how can I check the rules on which order the objects will be
> inserted on the DB by the DataContext? Maybe somesort of check function
> where I can see the current state of the Object Graph or something like
> that?
>
> Regards
> Bruno Santos
>
> --
> Bruno René Santos | brunorene@holos.pt | Gestor de Projectos | Analista |
> Programador | Investigador
>
> Holos - Soluções Avançadas em Tecnologias de Informação S.A.
> Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque
> Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal
> Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt
>
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you are not the intended recipient or the person responsible for
> delivering the email to the intended recipient, be advised that you have
> received this email in error and that any use, dissemination, forwarding,
> printing, or copying of this email is strictly prohibited. If you have
> received this email in error please notify Bruno René Santos by telephone
> on +351 210 438 686
>

Mime
View raw message