Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-466

Threads are blocked while creating LazyDynaBean objects.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.3
    • None
    • DynaBean
    • None

    Description

      We have extended LazyDynaBean class and using these derived classes as data beans.
      Thread dumps of our application shows lot of threads blocking to take lock of HashTable as follows

       
      "[ACTIVE] ExecuteThread: '33' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x0000000119978800 nid=0x96 waiting for monitor entry [0xfffffffd2cbfa000]
         java.lang.Thread.State: BLOCKED (on object monitor)
                      at java.util.Hashtable.get(Hashtable.java:333)
                      - waiting to lock <0xfffffffd7bcea6a0> (a java.util.Hashtable)
                      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:233)
                      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
                      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
                      at org.apache.commons.beanutils.LazyDynaBean.<init>(LazyDynaBean.java:119)
       

      Reasons:-
      1) LazyDynaBean have transient instance type Log object created at LazyDynaBean object creation.
      2) LogFactoryImpl uses Hashtable to cache Log instances.

      Our Proposal:-
      Can we differ creation of Log object until it is actually required? This class already have method logger() which creates Log object if it null(required for Deserialization). And same method currently is being used whenever Log object is required in this class. So we can keep Log object as null at LazyDynaBean object creation.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kuldeepak.bajaj kuldeepak bajaj
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: