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

Timothy Webb wrote:

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.

There was a similar question posted to the TopLink forum you might want to look at. http://forums.oracle.com/forums/thread.jspa?threadID=537599&tstart=0


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?

Yes, it is if you're just selecting the id using a native query and getting objects back. More below on this.


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'd just select only those attributes of a set of objects you want and, for convenience sake, build an object to hold those attributes. Take a look at section 4.8.2 of the JPA spec for an example. This is useful in cases where you want to populate a drop down in the UI and don't want to load the entire object.



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.

I find native queries very complicated and avoid them. If you've mapped your classes you should be able to get what you want with JPQL. We can take this offline if you like and you can email me your query?


--Shaun