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

JBossCMP (86)

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

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

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.


  • frank

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

    frank - 2004-09-14

    patch for LRUEnterpriseContextCachePolicy.java


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks