File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Persisting EJB Timer - Gives some exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Persisting EJB Timer - Gives some exception" Watch "Persisting EJB Timer - Gives some exception" New topic

Persisting EJB Timer - Gives some exception

Gopi Chand

Joined: Feb 04, 2007
Posts: 24
Hi Ranchers,

I have some problem with persisting ejb timer service.

java.lang.IllegalStateException: Unable to persist timer
at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
Caused by: com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -195: Column 'INSTANCEPK' in table 'TIMERS' cannot be NULL
at com.sybase.jdbc2.tds.Tds.processEed(
at com.sybase.jdbc2.tds.Tds.nextResult(
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(

and I am getting this exception. When I look at the sybase table definition, it says INSTANCEPK cannot accept null. So tried to change the way table is created, by using this ejb-timer-service.xml

<mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
<depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
<attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
<!--<attribute name="CreateTableDDL">
create table TIMERS
TIMERID varchar(50) NOT NULL,
TARGETID varchar(50) NOT NULL,
INTERVAL bigint,
INFO other,
constraint timers_pk primary key (TIMERID)

you can see I have comment out attribute tag, I thought this how table is defined. When I uncomment CreateTableDDL I am getting another error saying that "No such attribute as CreateTableDDL, since DatabasePersistencePolicy class doesn't have a equivalent set method.

Why is this happening and am I doing something wrong here !!

[ July 30, 2007: Message edited by: Jcoder ]
I agree. Here's the link:
subject: Persisting EJB Timer - Gives some exception
jQuery in Action, 3rd edition