In your example this
| public void MySchedule()
|
Is wrong. That's not a constructor it's a method. Remove the void.
You can use the constructor method but a better way is to use the @Create
annotation instead.
| @Entity
| @Name("mySchedule")
| @Table(name="my_schedule")
| @Scope(ScopeType.SESSION)
| @Startup
| public class MySchedule
| implements Serializable,
| {
|
| @Create
| public void create()
| {
| MyScheduleHome msh = (MyScheduleHome)
Component.getInstance("myScheduleHome");
| msh.Schedule();
| log.debug("Timer activated");
| }
| //Rest of the getters/setters for table.
| ...
| }
|
I would also suggest having @Entity and @Startup is bad practice. Your entity
object should be relatively clean and the scheduling code should probably be in
a session bean that may inject/create the entity bean.
Cheers.
Mike.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047679#4047679
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047679
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user