-
1. Re: EJB3 and Entity Caching
stemeyda Nov 16, 2005 6:36 PM (in response to sunnyyfl)I am having the same problem.
I am using @FlushMode(FlushModeType.COMMIT) above each method inside of my Stateless Session Bean.
Inside one of my methods I am trying create a query and get a result set.
@Entity
@Cache(...TRANSACTIONAL)
public class Rock {
@Id..auto
int id;
}
@Stateless
public class RockUpdater {
@FlushMode(FlushModeType.NEVER)
private List getList() {
//Get all the rocks...
getResultList()...///This is taking forever... and db is being hit
why is it not being pulled out of cache???????????????????????
}
@FlushMode(FlushModeType.COMMIT)
public void update(List updates) {
...
getList()
...update some of the rocks entity beans...
if not in the list.
create new rock and call rock.persist()
}
}
@Service
public class JoMBean{
@EJB
RockUpdater ru;
..//within a TimerTask...
ru.update(List moldspores);
}
I tried to use Stateful (EXTENDED Entitymanager) but the darn thing was passivating during active method calls from a service. Says it timed out. I was in the middle of a method call... how could it time out? -
2. Re: EJB3 and Entity Caching
alesj Nov 18, 2005 6:19 AM (in response to sunnyyfl)Regarding caching ... you should probably implement hashCode and equals on entities.
-
3. Re: EJB3 and Entity Caching
stemeyda Dec 1, 2005 7:18 PM (in response to sunnyyfl)Still having the same problem. Is this a bug?
-
4. Re: EJB3 and Entity Caching
doubledenim Oct 31, 2008 4:10 AM (in response to sunnyyfl)I'm finding exactly the same problem. Does anyone know a solution to this?