RequestFactory expects a session-per-request pattern with the session guaranteeing a single instance per entity (i.e. using a cache).
The proper fix is to have isLive
hit that cache, not the database. If you use JPA or JDO, they should do that for you for free. What matters is what "the request" thinks about it (if you issued a delete request, isLive
should return false
), not really what's exactly stored in the DB, taking into account what other users could have done concurrently.
That being said, isLive
is only used for driving EntityProxyChange
events on the client side, so if you don't use them, it shouldn't cause any problem unconditionally returning true
like you do.