#517 fix parameters limit (which limit max-bean-age to 24 days!)

open
nobody
JBossCMP (86)
9
2004-09-14
2004-09-14
frank
No

The code in LRUEnterpriseContextCachePolicy.java does
not allow to provide a max-bean-age > 24days :

int p = Integer.parseInt(op);
if (p <= 0) {throw new DeploymentException
("Overager period can't be <= 0");}
m_overagerPeriod = p * 1000;

while the m_overagerPeriod is correctly declared as long,
the parameter is read from configuration file as an
integer. But much worse is the next line where the int
value is multiply by 1000 --> this lead that if you don't
want an integer overflow to provide a max value of
2^31/1000 (int max value/1000) which is about 24 days
(I need long duration cache for values that take me
hours to computed and that won't change for 1 or 2
monthes)!

So my patch fix this by making the p parameter a long. I
did it for all parameters retrieved from the configuration
file.

The problems is present on the 3.2.x branch (last cvs
version), I didn't look at 4.x version but I guess the
problem is also there.

Discussion

  • frank
    frank
    2004-09-14

    • priority: 5 --> 9
     
  • frank
    frank
    2004-09-14

    patch for LRUEnterpriseContextCachePolicy.java

     
    Attachments