ok, maybe the problem is that I copy the object to a new context?

this.localContext = CayenneUtils.createNewContext();

this.baseEntity = localContext.localObject(baseEntity);


then I do a cast

Recipes recipe = Recipes.class.cast(baseEntity);


and try to get a property, which throws the Exception

recipe.getGroupings()


Groupings is a to many list reference

<obj-relationship name="groupingsRecipes" source="Groupings" target=
"Recipes" deleteRule="Nullify" db-relationship-path=
"groupingsRecipes.recipe"/>

<db-entity name="groupings" catalog="balecon">

<db-attribute name="changed_at" type="TIMESTAMP"/>

<db-attribute name="changed_by" type="CHAR" length="36"/>

<db-attribute name="cookbook_id" type="CHAR" length="36"/>

<db-attribute name="created_at" type="TIMESTAMP"/>

<db-attribute name="created_by" type="CHAR" length="36"/>

<db-attribute name="entity" type="CHAR" isMandatory="true" length="40"/>

<db-attribute name="id" type="CHAR" isPrimaryKey="true" isMandatory="true"
length="36"/>

<db-attribute name="name" type="VARCHAR" length="255"/>

</db-entity>

<db-entity name="groupings_recipes" catalog="balecon">

<db-attribute name="grouping_id" type="CHAR" isPrimaryKey="true" isMandatory
="true" length="36"/>

<db-attribute name="recipe_id" type="CHAR" isPrimaryKey="true" isMandatory=
"true" length="36"/>

</db-entity>

<db-entity name="recipes" catalog="balecon">

<db-attribute name="changed_at" type="TIMESTAMP" length="19"/>

<db-attribute name="changed_by" type="CHAR" length="36"/>

<db-attribute name="created_at" type="TIMESTAMP" length="19"/>

<db-attribute name="created_by" type="CHAR" length="36"/>

<db-attribute name="deleted" type="BIT" isMandatory="true" length="1"/>

<db-attribute name="disabled" type="BIT" isMandatory="true" length="1"/>

<db-attribute name="frequency" type="REAL" length="12"/>

<db-attribute name="id" type="CHAR" isPrimaryKey="true" isMandatory="true"
length="36"/>

<db-attribute name="internal_note" type="LONGVARCHAR" length="65535"/>

<db-attribute name="loss_factor" type="DECIMAL" length="10" scale="2"/>

<db-attribute name="photos" type="LONGVARCHAR" length="65535"/>

<db-attribute name="production" type="BIT" isMandatory="true"/>

<db-attribute name="published" type="BIT" isMandatory="true" length="1"/>

<db-attribute name="source_id" type="CHAR" length="36"/>

<db-attribute name="unit" type="CHAR" length="3"/>

<db-attribute name="video_url" type="VARCHAR" length="255"/>

<db-attribute name="visited_at" type="TIMESTAMP" length="19"/>

</db-entity>


<obj-entity name="Groupings" className="at.balecon.portal.db.Groupings"
dbEntityName="groupings">

<obj-attribute name="changedAt" type="java.sql.Timestamp" lock="true"
db-attribute-path="changed_at"/>

<obj-attribute name="changedBy" type="java.lang.String" db-attribute-path=
"changed_by"/>

<obj-attribute name="cookbookId" type="java.lang.String" db-attribute-path=
"cookbook_id"/>

<obj-attribute name="createdAt" type="java.sql.Timestamp" db-attribute-path=
"created_at"/>

<obj-attribute name="createdBy" type="java.lang.String" db-attribute-path=
"created_by"/>

<obj-attribute name="entity" type="java.lang.String" db-attribute-path=
"entity"/>

<obj-attribute name="id" type="java.lang.String" db-attribute-path="id"/>

<obj-attribute name="name" type="java.lang.String" db-attribute-path="name"
/>

</obj-entity>


<obj-entity name="Recipes" className="at.balecon.portal.db.Recipes"
lock-type="optimistic" dbEntityName="recipes">

<obj-attribute name="changedAt" type="java.sql.Timestamp" lock="true"
db-attribute-path="changed_at"/>

<obj-attribute name="changedBy" type="java.lang.String" db-attribute-path=
"changed_by"/>

<obj-attribute name="createdAt" type="java.sql.Timestamp" db-attribute-path=
"created_at"/>

<obj-attribute name="createdBy" type="java.lang.String" db-attribute-path=
"created_by"/>

<obj-attribute name="deleted" type="boolean" db-attribute-path="deleted"/>

<obj-attribute name="disabled" type="boolean" db-attribute-path="disabled"/>

<obj-attribute name="frequency" type="float" db-attribute-path="frequency"/>

<obj-attribute name="id" type="java.lang.String" db-attribute-path="id"/>

<obj-attribute name="internalNote" type="java.lang.String" db-attribute-path
="internal_note"/>

<obj-attribute name="lossFactor" type="java.math.BigDecimal"
db-attribute-path="loss_factor"/>

<obj-attribute name="photos" type="java.lang.String" db-attribute-path=
"photos"/>

<obj-attribute name="production" type="boolean" db-attribute-path=
"production"/>

<obj-attribute name="published" type="boolean" db-attribute-path="published"
/>

<obj-attribute name="sourceId" type="java.lang.String" db-attribute-path=
"source_id"/>

<obj-attribute name="unit" type="java.lang.String" db-attribute-path="unit"
/>

<obj-attribute name="videoUrl" type="java.lang.String" db-attribute-path=
"video_url"/>

<obj-attribute name="visitedAt" type="java.sql.Timestamp" db-attribute-path=
"visited_at"/>

<post-persist method-name="onPostPersist"/>

<post-update method-name="onPostUpdate"/>

<post-remove method-name="onPostRemove"/>

</obj-entity>





Am Do., 14. Nov. 2024 um 15:13 Uhr schrieb Andrus Adamchik <
aadamc...@gmail.com>:

> FaultFailureExceptions are usually caused by referential integrity
> problems in DB. But this one is unusual as it references a TEMP ID (i.e. an
> uncommitted object). I don't think I've seen this flavor. Can you provide
> some more context around the error. I.e. what code leads to this.
>
> Andrus
>
>
> > On Nov 14, 2024, at 9:07 AM, Markus Reich <reich.mar...@gmail.com>
> wrote:
> >
> > Hi,
> >
> > in my production environment sometimes I get the following errors:
> >
> > FaultFailureException
> >
> > [v.4.2.1 Jun 14 2024 07:43:08] Error resolving fault, no matching row
> > exists in the database for ObjectId:
> > <ObjectId:Recipes,TEMP:-639058002>
> >
> >
> > they are not specific to a certain object and I did get it
> > reproducible to debug it :-/
> >
> >
> > Maybe someone has some hints or tipps to get the root of evil?
> >
> >
> > regards
> >
> > Meex
>
>

-- 
*Markus Reich*
Waldweg 62
6393 St. Ulrich am Pillersee
reich.mar...@gmail.com

Reply via email to