I did it yesterday and now I'm getting the already known NPE again. And I'm 
sure that I didn't changed the cayenne version. But what I saw is that in the 
case of NPE always the same method of me is called. As a starting point I can 
synchronize the method, but it shouldn't be neccessary. Here's the method that 
causes the NPE:

public boolean isLoggerAlreadyAvailable(DaoContextIfc ctx, String 
loggerSerialNumber) {
 DataContext context = getDaoContext(ctx);
    Expression expr = ExpressionFactory.matchExp("serialNumber", 
loggerSerialNumber).orExp(ExpressionFactory.matchExp("newSerialNumber", 
loggerSerialNumber));
    SelectQuery query = new SelectQuery(TblLogger.class, expr);
    List<TblLogger> loggerList = (List<TblLogger>) context.performQuery(query);
    if (loggerList.size() == 0) {
      return false;
    }
    return true;
 }

No instance variables are used. 

I've seen also that the class 'SQLTemplateResourceManager' uses a LRUMap.  And 
there wereall access to LRUMap already synchronized. Maybe you can take a look 
at that class.

Another question :
I have a class which is extended from 'WebApplicationListener'. In the method 
'sessionDestroyed' the following code is executed :

ObjectStore objectStore = dctx.getObjectStore();
objectStore.objectsInvalidated(objectStore.getObjects());

It that really neccessary ? The code was written by some programmers, which has 
leaved the company.

Thank, Lothar

> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> Gesendet: 15.06.06 11:51:59
> An: [email protected]
> Betreff: Re: IllegalStateException in DataRowStore (thrown by LRUMap)


> 
> On Jun 15, 2006, at 1:43 PM, Lothar Krenzien wrote:
> 
> > I'm using the recent 3.2 version of commons collection and the  
> > recent 1.2 RC1 cayenne version.  The exception occurs mostly on  
> > high high activitity on the server. But then very often.  Basicly  
> > my clients call a servlet and make a post. The servlet should  
> > import the posted data into a database (MSSQL 2000) using DAO  
> > classes.  The relevant methods in the DAO classes are all  
> > synchronized (even it should not be necessary).
> >
> > Hope that helps
> > Lothar
> 
> Thanks for the info. Can you downgrade to commons-collections 3.1?  
> This is the version we are currently using in Cayenne, so this is the  
> version I will be using as a part of CAY-565 investigation.
> 
> Andrus


_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000071

Reply via email to