[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[News.eclipse.technology.eclipselink] Re: Switching Maya to JPA / EclipseLink

Timothy Webb <tim@xxxxxxxxxxxxxxxxxxxx> wrote:
 
> shaun.smith@xxxxxxxxxx (Shaun Smith) wrote:
>  
>> Hi Tim,
>> 
>> Timothy Webb wrote:
>> 
>>> ...
>>> One is that when running against certain
>>> databases, we've noticed connection timeout issues that cause various
>>> unexpected failures.
>> 
>> In my use of TopLink Essentials in RCP I was using the internal connection 
>> pooling without any problems but I didn't have long periods of idle time 
>> so I never experienced any timeout problems.  Are you using the built in 
>> connection pooling or are you using you're container's connection pool?
> 
> We are using the internal connection pooling since currently not running 
> within a container.
> 
>>> Two is that there appears to be some caching of
>>> objects occurring.
>> 
>> There is definitely caching going on by default ;-).  Take a look at this 
>> blog [1] on the TopLink Essentials caching architecture.  There are many 
>> ways to tune the cache.  If you want objects to be reread from the 
>> database fresh in each transaction then you want to set the 
>> toplink.cache.shared.<ENTITY> property to false.  You can do this globally 
>> for all classes with the toplink.cache.shared.default property.
> 
> This was a very helpful reference and following it I've been able to get the 
> desired caching behavior.  One quirk I've noticed is that if I issue a native 
> query bound to a particular object, and only request the primary key field, 
> the object has all fields empty even if the object was already populated in 
> the cache.  Is this the expected behavior?  Or asking it another way, what 
> would you recommend if I wanted to get the current list of objects from the 
> DB, but the objects were large so I would rather not load all of the fields on 
> each request assuming the objects are already in the cache?  I've tried 
> executing a native query with response time as Vector and then doing 
> subsequent queries, or an IN clause, but this seems a bit ugly.
> 
>>> Our runtime is currently a standalone OSGi container using the Jetty
>>> server that has been integrated as part of the Equinox project.  When
>>> running in this environment, is there any recommendation you would 
>>> have regarding connection configuration and caching when in 
>>> development vs. full deployment?
>> 
>> Typically, cache configuration is the same in dev and deployment since it 
>> has a huge impact on the program.  Changes to the cache config can lead to 
>> significantly different results so best to get it setup as per your needs 
>> and leave it alone.
> 
> Thanks, that makes sense.
> 
> Cheers,
> Tim
> 
>