db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Prefetching concurrent problem
Date Tue, 15 Feb 2005 16:26:01 GMT
Hi all,

seems we have a concurrent problem in handling of prefetched collections.

When running the MultiThreadedTestCase I get sporadic errors on Identity 
creation (the error says that the PK values of the specified object are 
'null' - see below). Did someone else get these error message?

The test case show that this couldn't happen, it's guaranteed that the 
object has a valid PK. Think the problem is caused by the static methods 
of RelationshipPrefetcherFactory. If I change it (non static methods, 
add RelationshipPrefetcherFactory to PB instance) the error message no 
longer occur.

Will check in the changes to branch and trunk within a short time.

regards,
Armin

<error msg>
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: OJB 
needs at least one primary key attribute for class:
objectTopLevelClass=org.apache.ojb.broker.Project
objectRealClass=org.apache.ojb.broker.Project
pkValues=null

	at org.apache.ojb.broker.Identity.checkForPrimaryKeys(Identity.java:291)
	at org.apache.ojb.broker.Identity.init(Identity.java:155)
	at org.apache.ojb.broker.Identity.<init>(Identity.java:116)
	at 
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.associateBatched(MtoNCollectionPrefetcher.java:429)
	at 
org.apache.ojb.broker.accesslayer.MtoNCollectionPrefetcher.prefetchRelationship(MtoNCollectionPrefetcher.java:95)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(QueryReferenceBroker.java:342)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:169)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:246)
	at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:266)
	at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1318)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)
	at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:338)
	at 
org.apache.ojb.broker.metadata.MetadataMultithreadedTest$GlobalUsingBroker.runTestCase(MetadataMultithreadedTest.java:346)
	at 
org.apache.ojb.junit.JUnitExtensions$MultiThreadedTestCase$TestCaseRunnable.run(JUnitExtensions.java:186)
	at java.lang.Thread.run(Thread.java:534)

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message