The second thing to keep in mind is that the cache also has some limitations and, probably, can't keep the whole database in memory.
Pedro Salazar wrote:
On Thu, 2003-11-20 at 20:02, Alexey Loubyansky wrote:
Can't you calculate the value once and add a flag 'calculated' that will indicate it?
Good hint! But, I tried but I didn't understand one thing!
I invoke my a stateless method that calculates the sum of i from 1 to 10000, and put it in cache. However, after my bean has passivated, I invoked again my method to verify if the cache value has persisted, and realized a few things:
1- The cache has persisted (OK as expected)
2- After the primitive has been activated, the bean was LOADED??? I didn't understood why is that happened? My entity bean is read-only!!! Every time the bean is activated is also loaded from the database???
I read the spec and the sequential diagrams confirmed that but I thought if a entity bean was read-only, the passivate wouldn't serialize the values avoiding the loading from database...?
There is a log below showing this case:
" 21 Nov 2003 11:45:15,355 DEBUG [pt.ptinovacao.nginpro.uif.service.ejb.PrimitiveBean] Passivate Primitive
21 Nov 2003 11:45:32,698 DEBUG
[pt.ptinovacao.nginpro.uif.service.ejb.PrimitiveBean] Activate Primitive
21 Nov 2003 11:45:32,702 DEBUG
[pt.ptinovacao.nginpro.uif.service.ejb.PrimitiveBean] Load Primitive ...
21 Nov 2003 11:45:32,704 INFO [pt.ptinovacao.nginpro.uif.service.ejb.PrimitiveBean] (cache) sum is
49995000
21 Nov 2003 11:45:32,705 INFO [pt.ptinovacao.nginpro.uif.service.ejb.ServiceInfoBean] value->49995000
"
regards, Pedro Salazar.
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user