users@glassfish.java.net

Time(r) for trouble

From: <glassfish_at_javadesktop.org>
Date: Tue, 25 May 2010 05:38:35 PDT

Hi to all.
My first post here, I always check this forum for guidelines and suggestions so I thank you all for the precious help.
I made a search before posting but found nothing, I hope to post in the correct section.

I have a glassfish (v3 build 74.2) installed on a debian linux (2.6.26-2-amd64) with sun java v6u20.
Having some tests with scheduled copy of data from a database to another, this morning I undeployed my ear application but glassfish appears to have not expunged the timer associated with the app. If I try to redeploy my app, I get an EJBException:

[i]Exception while loading the app javax.ejb.EJBException at com.sun.ejb.containers.EJBTimerService.createEJBException(EJBTimerService.java[/i]

This is a little extract from the log:

[i]... Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: An SQL data change is not permitted for a read-only connection, user or database. Error Code: 20000 Call: INSERT INTO EJB__TIMER__TBL (TIMERID, BLOB, INITIALEXPIRATIONRAW, SCHEDULE, INTERVALDURATION, OWNERID, STATE, LASTEXPIRATIONRAW, PKHASHCODE, CREATIONTIMERAW, CONTAINERID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [9@@1274779192846@@server@@domain1, [B_at_1189857e, 1274792400000, 0 # 0 # 0/1 # * # * # * # * # null # null # null # true # [b]importaGiacenze[/b] # 0, 0, server, 0, 0, 0, 1274789405048, 83543919289827330] Query: InsertObjectQuery(com.sun.ejb.containers.TimerState_at_46838f70) ...[/i]

That [b]importaGiacenze[/b] is my scheduled method, and I think that the SQL error is reported as -from that method- I try to access an external unmanaged database (via DriverManager.getConnection(...)). The method is annotated this way:
[i]@Schedule(hour = "0/1") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)[/i]
while the other connection (this one is managed) has the 'Non Transactional Connections' property checked (enabled) in the GF admin panel.

I just have sit down and wait to see if timers will expunge themselves eventually, but that's not happened. I searched the manual, but I could only find the command 'list-timers' - which tells me there are 2 active timers btw. Now I don't really know what to do.

I take advantage of this post to ask for help with another question: can I deploy an EJB with two method annotated as @Schedule, or is limited to just once for each EJB?

A sincere thanks to anyone who could help me,
Ivan
[Message sent by forum member 'gioz79']

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