1 Reply Latest reply on Dec 23, 2001 3:07 AM by acarrano

    MySQL and EJB persistance

    csmike

      Hi all,

      I have a problem with JBoss EJB persistance to MySQL.

      I have an EJB associated with a Innodb table in MySQL. When I "create" an EJB in my JSP page, everything ran fine but the new record in the table didn't get created.

      However, after many traces, I changed my table type from Innodb to MyISAM. Then, the EJB worked as it should be.

      I wonder if anybody can share some thoughts about this and if there is work around on this.

      Best regards,
      Michael

        • 1. Re: MySQL and EJB persistance
          acarrano

          I have seen this behavior when the EJB's transaction attribute is not set to "Required" (on your ejb-jar.xml file). You can set it to "Required" (as shown in the example below) and that should store the EJB on your table.

          <ejb-jar>
          <assembly-descriptor>
          ...
          <container-transaction>

          <ejb-name>EcommerceCustomerBean</ejb-name>
          <method-name>*</method-name>

          <trans-attribute>Required</trans-attribute>
          </container-transaction>
          ...
          </assembly-descriptor>
          </ejb-jar>

          This is not a very good solution since setting this attribute to Required on all of your entity EJB's may reduce performace.