EJB programming & troubleshooting: [Q] WLS read-only entitybeans and NotSupported trans-attribute

  1. Hi,

    The Weblogic 6.1 documentation (see http://edocs.bea.com/wls/docs61/ejb/EJB_environment.html#1074846) says:

    "Entity EJBs using the read-only concurrency strategy must observe the following restrictions:
    - Their transaction attributes must be set to NotSupported (the beans cannot rely on a transaction)."

    Why should this restriction be there? I wrote a test ejb just to test this out, and it seemed to work quite well with trans-attribute=Required. So what can be the issue if I don't set NotSupported?

    To explain, the reason I am unhappy with NotSupported is as follows:
    - I have an SLSB calling the read-only EntityBean (EB)
    - The SLSB calls several methods in the EB within one SLSB transaction.
    - If the EB has a trans-attribute=NotSupported, then each EB method invocation seems to spawn a new transaction within the EB. The transaction begin/commit take up a lot of time.

    I understand that fine-grained EB methods have a performance overhead. However, I am not calling the EB from outside the container; only the SLSB calls the EB. The actual method call itself is very quick, but the container does a preInvoke() and postInvoke() before and after each method call on the EB, which is where the time goes.

    So, could someone explain the reason for this restriction, and/or suggest a solution for the performance issue? I really would like to avoid adding an ugly getValueObject() method on my entity interface.

  2. It seems like this limitation has been removed in wls7.0. There is no more reference to it in the documentation.
    So maybe you need to move to it !