Announcement Announcement Module
Collapse
No announcement yet.
In Spring/Hibernate, Acl taglib hangs app in high load Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • In Spring/Hibernate, Acl taglib hangs app in high load

    Hello everyone,

    Just wanted to see if anyone else had encountered this. I'm using:

    - Spring 1.1.4
    - Hibernate 2.1.8
    - ...with HibernateInterceptor and OpenSessionInView
    - Acegi 0.8.2 with ACL setup

    Everything seems to work fine in my webapp, so when I started doing some stress testing, we found an interesting thing... at low loads, everything was fine.

    However, at high loads, pages with the ACL tag would eventually hang and give an error that says:

    Code:
    2005-06-11 15&#58;52&#58;56,455 DEBUG &#91;net.sf.hibernate.impl.BatcherImpl&#93; - <about to open&#58; 100 open PreparedStatements, 0 open ResultSets>
    where 100 is some arbitrary number, based on how many times the page has been hit.

    Once I remove the AclTag, everything seems to work, and the webapp never hangs.

    Here's how I'm using the tag:

    Code:
    <authz&#58;acl domainObject="$&#123;model.challenge&#125;" hasPermission="32">
      Here's some secure text.
    </authz&#58;acl>
    Anyone else notice this? For now we're going to stop using the authz tag and pass in booleans from the controller, but it sure would be nice to use the nice Acegi JSP tags..

    Andrew

  • #2
    Quick followup using hasPermission()

    So I removed all the authz tags, and am using hasPermission() instead, and passing a bunch of booleans through the model into the view, in order to figure out what to display.

    When I do this, I still get problems at high load. Here's an excerpt at the last bit, before it hangs:

    Code:
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.basic.BasicAclProvider&#93; - <domainInstance&#58; o
    rg.phatcast.db.Challenge@3 attempting to pass to constructor&#58; public net.sf.acegisecurity.acl.basic.
    NamedEntityObjectIdentity&#40;java.lang.Object&#41; throws java.lang.IllegalAccessException,java.lang.reflec
    t.InvocationTargetException>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.basic.BasicAclProvider&#93; - <domainInstance&#58; o
    rg.phatcast.db.Challenge@3 attempting to pass to constructor&#58; public net.sf.acegisecurity.acl.basic.
    NamedEntityObjectIdentity&#40;java.lang.Object&#41; throws java.lang.IllegalAccessException,java.lang.reflec
    t.InvocationTargetException>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.basic.BasicAclProvider&#93; - <obtainIdentity re
    turned net.sf.acegisecurity.acl.basic.NamedEntityObjectIdentity&#91;Classname&#58; org.phatcast.db.Challenge
    ; Identity&#58; 3&#93;>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.AclProviderManager&#93; - <ACL lookup using net.
    sf.acegisecurity.acl.basic.BasicAclProvider>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.basic.BasicAclProvider&#93; - <domainInstance&#58; o
    rg.phatcast.db.Challenge@3 attempting to pass to constructor&#58; public net.sf.acegisecurity.acl.basic.
    NamedEntityObjectIdentity&#40;java.lang.Object&#41; throws java.lang.IllegalAccessException,java.lang.reflec
    t.InvocationTargetException>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;net.sf.acegisecurity.acl.basic.BasicAclProvider&#93; - <Looking up&#58; net.s
    f.acegisecurity.acl.basic.NamedEntityObjectIdentity&#91;Classname&#58; org.phatcast.db.Challenge; Identity&#58;
    3&#93;>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;org.springframework.jdbc.core.JdbcTemplate&#93; - <Executing SQL query &#91;S
    ELECT CHILD.ID, CHILD.OBJECT_IDENTITY, CHILD.ACL_CLASS, PARENT.OBJECT_IDENTITY as PARENT_OBJECT_IDEN
    TITY FROM acl_object_identity as CHILD LEFT OUTER JOIN acl_object_identity as PARENT ON CHILD.parent
    _object=PARENT.id WHERE CHILD.object_identity = ?&#93;>
    2005-06-11 16&#58;30&#58;15,504 DEBUG &#91;org.springframework.jdbc.datasource.DataSourceUtils&#93; - <Opening JDBC
    connection>
    After this point, it basically sits there, trying to get the JDBC connection, but can't. As soon as the webapp hits this particular state, then it can no longer execute queries (through Hibernate or through Acegi's JDBC queries).

    Any thoughts on why this is happening? I'm using the MySQL JDBC driver 3.1.8, which is the newest generally available one...

    Comment


    • #3
      Which connection pool are you using? Have you tried increasing the number of connections in the pool? Are you using caching against the BasicAclProvider, to avoid hitting the RDBMS to begin with?

      Comment

      Working...
      X