Finder methods and transactions

Discussions

EJB programming & troubleshooting: Finder methods and transactions

  1. Finder methods and transactions (1 messages)

    I am developing an enterprise bean, and i am using the j2ee server provided with J2EE SDK Enterprise Edition.
    I have some problems which I cannot solve:
    - only findByPrimaryKey works: if I try and call findBySomeField and then call a business method like getField it returns only null values. Looking at the server output it looks like the container never calls ejbLoad or ejbStore.
    - if I set transaction parameters as REQUIRED I receive the exception "Transaction aborted (possibly due to transaction timeout).
    My bean is very similar to another one which perfectly works: since the only difference is the fact that the new one has some serializable types as fields I am thinking maybe this is the problem, even if the ejbCreate method works and correctly stores data in the database.
  2. Finder methods and transactions[ Go to top ]

    hi

    You can specify any finder method finfByxxx(<parameter list>)

    You can use any of CMP/BMP

    It works fine

    But remember in CMP check syntax
    e.g
    select "id" from "table" where "tt"=?1

    ?1 is required and represents first parameter
    similarly ?2,?3.... represents second,third parameter

    I tries all this in J2ee server



    somal