users@glassfish.java.net

How to enable EJB Timer on GlassFish Cluster?

From: <glassfish_at_javadesktop.org>
Date: Fri, 30 Apr 2010 04:42:54 PDT

I need to enable an EJB Timer on a glassfish cluster server. I first created an external db for the timer according to:
http://programmaremobile.blogspot.com/2009/02/clustering-and-ejb-timer-eng.html

What I have done (with MySQL 5.1.6 + GlassFish v2.1 + EJB 3):
1. Create a new database named "ejbtimer";
2. Create a table in "ejbtimer":
CREATE TABLE EJB__TIMER__TBL (
CREATIONTIMERAW bigint NOT NULL,
`BLOB` BLOB,
TIMERID VARCHAR (255) NOT NULL,
CONTAINERID bigint NOT NULL,
OWNERID VARCHAR (255) NOT NULL,
STATE INTEGER NOT NULL,
PKHASHCODE INTEGER NOT NULL,
INTERVALDURATION bigint NOT NULL,
INITIALEXPIRATIONRAW bigint NOT NULL,
LASTEXPIRATIONRAW bigint NOT NULL,
CONSTRAINT PRIMARY KEY (TIMERID)
);
3. Create a connection pool for this db in GlassFish web console.
4. Ping the new data connection pool successfully.
5. Create a data source for this pool.
6. Set the new data source for the EJB Timer Service.

But when I run a EJB Timer in my EJB3 application, it still gives:
 "java.lang.IllegalStateException: EJB Timer Service not available"

I am testing to use an external db for the EJB timer service in a standalone machine. It has not yet been deployed to the cluster.

Could you please help me?
[Message sent by forum member 'raejean99']

http://forums.java.net/jive/thread.jspa?messageID=399744