Hello everyone!
I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, City.txt

targetgroup.txtwith manytomany relationship.
when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:

public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
Targetgroup targetgroupForUpdate = find(pkForUpdate);

targetgroupForUpdate.setGender(newGender);
targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));

//pronalazenje gradva za koje je vezana ciljna grupa
Collection<City> newCitiesCollection = new ArrayList<City>();

for(int i = 0; i < newCities.length; i++){
String tmp_city_name = newCities[i];
City city_obj = cityFacade.find(tmp_city_name);
newCitiesCollection.add(city_obj);
}
targetgroupForUpdate.setCityidCollection(newCities Collection);



}

parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
this code throws following exception:

[#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
javax.transaction.RollbackException: Transaction marked for rollback.
at
.
.
.com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
at $Proxy149.update(Unknown Source)
at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
|#]

exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
i thought it was going to figure it out by itself, and only update those rows.

Does anyone know what is the problem and solution?
Thanks! (forgive my spelling errors :)