Sun GlassFish Enterprise Server v3 Release Notes

EJB Timer Service config issue for MySQL (Issue 11428)

Description

Able to create and store EJB timer in MySQL as user, but when trying to configure EJB Timer Service for MySQL, get the following exception (SQLException executing statement):


"CREATE TABLE EJB__TIMER__TBL (TIMERID
VARCHAR(255) NOT NULL, BLOB BLOB(64000), INITIALEXPIRATIONRAW BIGINT, SCHEDULE
VARCHAR(255), INTERVALDURATION BIGINT, OWNERID VARCHAR(255), STATE INTEGER,
LASTEXPIRATIONRAW BIGINT, PKHASHCODE INTEGER, CREATIONTIMERAW BIGINT,
CONTAINERID BIGINT, PRIMARY KEY (TIMERID))":
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'BLOB BLOB(64000), INITIALEXPIRATIONRAW BIGINT,
SCHEDULE VARCHAR(255), INTERVALDU' at line 1|#] 

For more information, see Issue report.

Workaround

Make sure that the datasource-classname specified for the timer pool represents an XA DataSource.

MySQL-specific steps:

  1. Unpack glassfishv3/glassfish/lib/install/applications/ejb-timer-service-app.war.

  2. Add the following to WEB-INF/classes/__ejb_timer_mappings.xml after <persistence-unit-metadata>:

    <persistence-unit-defaults>
    <delimited-identifiers/>
    </persistence-unit-defaults>
  3. Repackage the WEB-INF/classes/__ejb_timer_mappings.xml file.

  4. (This step required only if the current installation has already used the EJB Timer Service.) Manually create the EJB__TIMER__TBL in the database using this create statement:

    CREATE TABLE `EJB__TIMER__TBL` (`TIMERID` VARCHAR(255) NOT NULL,
    `BLOB` BLOB(64000), `INITIALEXPIRATIONRAW` BIGINT, `SCHEDULE` VARCHAR(255),
    `INTERVALDURATION` BIGINT, `OWNERID` VARCHAR(255), `STATE` INTEGER,
    `LASTEXPIRATIONRAW` BIGINT, `PKHASHCODE` INTEGER, `CREATIONTIMERAW` BIGINT,
    `CONTAINERID` BIGINT, PRIMARY KEY (`TIMERID`))