Re: AW: [OJB-developers] Let's fix the testsuite!
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-05-28 21:05:52
|
Hi again, Oleg Nitz wrote: > Hi Thomas, > > On Tuesday 28 May 2002 10:14, Mahler Thomas wrote: > >>>But maybe there are some problems with this? >>> >>I don't see any. in storeMtoNImplementor() we should check if an entry >>already exists. If so do nothing, else insert a new entry. >> > No you mean repetitive database lookups? yes, that's ugly, that's why I implemented it the "easy" way initially... > >>>BTW I wonder if the current algorithm works when some link >>>between Persons >>>and Projects is removed. >>> >>Currently there is no support to remove m:n entries automatically. They >>have to be deleted manually. >> > I see. To achieve this we should either remember the original state of the > m:n relation or to read the set of all indirection instances from the > database in storeMtoNImplementor(), then compare them against the current set > of indirection instances in memory, then insert/delete the two differences of > two sets. Then there is no need in multiple database lookups. > This sounds good, but we must be very careful wrt. to concurrent transaction. The basic design of a broker is to be an stateless service. Of course a broker has a transaction state, but is does not know anything about the state of persistent instances. Once we start to store object state information within the broker we'll need a lot more thinking. (concurrent transactions, broker pooling mechanism, cache synchronization accross JVM, setc.) A much simpler aproach: before inserting entries for a given relation in storeMtoNImplementor(), just delete all existing entries. This way we - can avoid exception caused by failing inserts, - won't need to track object state to detect removed entries. Overhead should be rather small we'll need to execute only one DELETE statement. what do you think? Thomas > >>I'll have a look at 4. and 5. then! >> > Okay! :) > > Thanks, > Oleg > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |