* using platform="MsSQLServer"

----- Original Message ----- 
From: "Mark Neighbors" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, January 06, 2005 3:42 PM
Subject: trouble with 1-to-1 composition - simultaneous delete and query


> +------+         +-----------------------+
> | Item |------>| ItemComponent |
> +------+         +-----------------------+
>
> * Using the odmg layer
>
> * two simultaneous transactions
>      * one deletes a single Item/ItemComponent pair
>      * the other does an oql query to retrieve all Item/ItemComponent pairs
>
> * works with ObjectCacheDefaultImpl
> * does not work with ObjectCachePerBrokerImpl
>     * get the exception below from the materialization code during a query
>       that is simultaneous with a delete
>          * no ItemComponent is found for one of the retrieved Items
>     * everything works if not simultaneous
>
> * we are moving to ObjectCachePerBrokerImpl until the two-level global cache 
> is official
>
> * we are at ojb rc6
>
> * The reference-descriptor for ItemComponent inside Item's class-descriptor 
> has
>      * auto-delete="true"
>
> * in OJB.properties
>      *
> PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl
>           * i.e. using JavaBeans compliant calls only to access persistent 
> attributes
>
> * in jdbc-connection-descriptor
>      * tried useAutoCommit="1" and "2" where
>           * 1 - set autoCommit explicit 'true' when connection created
>                 and temporary set to 'false' when necessary (default mode).
>           * 2 - set autoCommit explicit 'false' when connection created.
>      * the exception occurs in both cases
>
> * Item/ItemComponent pairs are deleted with this method in class Item
>
>      public void markDelete()
>      {
>         ...
>         OJB.getInstance().getDatabase(this).deletePersistent(this);
>         ...
>      }
>
> * get this exception from the materialization code during a query that is
>   simultaneous with a delete
>
>   [DEFAULT] ERROR: Error in [PersistentFieldPropertyImpl],
> java.lang.reflect.InvocationTargetException
>   [DEFAULT] ERROR: Declaring class [com.company.package.Item]
>   [DEFAULT] ERROR: Property Name [itemComponent]
>   [DEFAULT] ERROR: Property Type [com.company.package.IItemCopmponent]
>   [DEFAULT] ERROR: anObject was class [com.company.package.Item]
>   [DEFAULT] ERROR: aValue was null
>
>   org.apache.ojb.broker.metadata.MetadataException:
>      Error invoking method:setItemComponent in object:com.company.package.Item
>         at
>
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl.doSet(PersistentFieldIntr
> ospectorImpl.java:97)
>         at
>
org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField.set(AbstractPersistentField.java:
> 98)
>         at
>
org.apache.ojb.broker.accesslayer.ReferencePrefetcher.associateBatched(ReferencePrefetcher.java:86)
>         at
> org.apache.ojb.broker.accesslayer.BasePrefetcher.prefetchRelationship(BasePrefetcher.java:111)
>         at
>
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(QueryReferenceBroker.java:277)
>         at
>
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:146)
>         at
>
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:203)
>         at
>
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:120
> 1)
>         at
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBro
> ker.java:321)
>         at
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBro
> ker.java:321)
>         at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(OQLQueryImpl.java:246)
>         at com.company.package.AClass.getItemListFromOQLQuery(AClass.java:nnn)
>         ...
>   Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at
>
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImpl.doSet(PersistentFieldIntr
> ospectorImpl.java:91)
>         ... 26 more
>   Caused by: java.lang.NullPointerException
>         at com.company.package.Item.setItemComponent(Item.java:nnn)
>         ... 30 more
>
> * The bean method setItemComponent was passed null
>
> * It appears that the query gets a Item that has no ItemComponent in the 
> database
>
> * Can anybody help?
>
> Thanks,
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to