users@glassfish.java.net

Re: How to enable EJB Timer on GlassFish Cluster?

From: <glassfish_at_javadesktop.org>
Date: Wed, 26 May 2010 02:29:30 PDT

The ejbTimer bean shall update some values in other database under the same database server.
[b]
If the ejbTimerPool is configured to use:[/b]
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
and javax.sql.DataSource

It can successfully run the timer twice and then gives error:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.IllegalStateException: [b]Local transaction already has 1 non-XA Resource: cannot add more resources[/b]. .....
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305) at oracle.toplink.essentials.jndi.JNDIConnector.connect(JNDIConnector.java:150) at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184) at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:233) at


[b]Expunging timer [/b]['1@@1274864648011@@server@@domain1' 'TimedObject = MetaTimerBean' 'Application = Core' 'BEING_DELIVERED' 'PERIODIC' 'Container ID = 83549411611377694' 'Wed May 26 12:04:08 EEST 2010' '600000' ] [b]after [2] failed deliveries[/b]...

So it expunged the ejbTimer!
[b]
If the ejbTimerPool is configured to use:[/b]
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
and javax.sql.XADataSource

It gives error:
Unable to initialize EJB Timer Service. [b]The likely cause is the database has not been started or the timer database table has not been created. [/b]

As you can see from the screenshots in my original post, the database for the ejbTimer is created. Ping successfully! And it DOES find the database if javax.sql.DataSource is used!

Can anybody tell how do you configure an external datasource for an EJBTimer?
[Message sent by forum member 'raejean99']

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