[JBoss Seam] - Inserting multiple records using Home Entity
by terryb
Is it possible to insert more than one record in to database using the EntityHome object? I get following error, and not sure how to go around it.
javax.persistence.PersistenceException: org.hibernate.HibernateException: identifier of an instance of au.edu.tisc.entity.OrgUserActivityLog was altered from 10001 to 10002
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:299)
In my example, I am trying to insert user activity records in to the table during the authentication process called from Authenticator.authenticate. If I insert only one record it works ok; but if I try to insert another I get error on .persist() call.
@Name("authenticator")
public class Authenticator {
public boolean authenticate() {
@In(value = "activityLogger", required = false, create = true)
private ActivityLogger activityLog;
...
... validate user details ...
...
activityLog.log(...); <--insert first record - works ok
...
...
activityLog.log(...); <--try to insert another - causes error
...
}
}
@Name("activityLogger")
public class ActivityLogger {
public void log(OrgUser orgUser, String action) {
OrgUserActivityLogHome orgUserActivityLogHome = (OrgUserActivityLogHome) Component.getInstance(OrgUserActivityLogHome.class, true);
OrgUserActivityLog orgUserActivityLog = orgUserActivityLogHome.getInstance();
orgUserActivityLog.setId(KeyGenerator.getKey());
orgUserActivityLog.setAction(action);
orgUserActivityLog.setOrganisationUser(orgUser);
orgUserActivityLogHome.persist(); <-- Above error thrown here on 2nd insert.
}
}
I am not sure why, error occurs on 2nd call; since first record insert had already called .persist() on the Entity Home object.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088693#4088693
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088693
18 years, 7 months
[JBossWS] - Re: jbossWS -
by birke
I was searching in my jmx-console but i find three entries:
| jboss.j2ee:
| jar=wfm-server.jar,name=WebServiceNotificationBean,service=EJB3
|
| jboss.management.local:
| J2EEApplication=null,J2EEServer=Local,WebModule=sanssouci-application.jar-wfm-server.jar-ws58591.war,j2eeType=Servlet,name=WebServiceNotificationBean
|
| jboss.web:
| J2EEApplication=none,J2EEServer=none,WebModule=//localhost/wfm-server,j2eeType=Servlet,name=WebServiceNotificationBean
|
but in none of these sites behind the link is written something like "id". sorry i am a quite newbee with the inner core of jboss, i use it mostly for hosting just my ejb's. so please tell me where exact i will find the usefull entry in the jmx-console.
with great thanks ... your birke
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088689#4088689
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088689
18 years, 7 months
[JBoss jBPM] - Re: Task list of specified actor
by dleerob
Thanks Ronald,
I have tried your example, however, there doesn't seem to be a method getIdentityService(); There is a getService(String name) method, so I thought that perhaps I should pass in some sort of 'Identity Service' name, so I looked in Services.java and found these service names defined:
| public static final String SERVICENAME_AUTHENTICATION = "authentication";
| public static final String SERVICENAME_AUTHORIZATION = "authorization";
| public static final String SERVICENAME_TX = "tx";
| public static final String SERVICENAME_LOGGING = "logging";
| public static final String SERVICENAME_MESSAGE = "message";
| public static final String SERVICENAME_PERSISTENCE = "persistence";
| public static final String SERVICENAME_SCHEDULER = "scheduler";
| public static final String SERVICENAME_JCR = "jcr";
| public static final String SERVICENAME_ADDRESSRESOLVER = "addressresolver";
There doesn't seem to be anything for an Identity Service?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088683#4088683
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088683
18 years, 7 months