Here is my irritating issue. 

I'm having two entity beans 
One is Film and another one is Copy. 

there is one to many relationship between them (there can be many copies of one 
film). 

I have created a web form were i put the film data and the count of copies. 
Then in the bussiness code I'm creating the film i persist the film bean and 
then i create "count of copies" times Copy bean and fill each copy data. When I 
try to persist them (the copies) I get ORA-02291 (Parent foreign key not found) 
- this is because a batch update takes place. The Film is not in the database. 
When i persist the film, and afterwards persist the copies I don't get this 
problem but I want to have the copies created immediately when the film data is 
specified. How can I make JBoss store the film data before storing the copies? 
I've tried the EntityManager.flush() but it doesn't work... 

it seems like the flush() is the problem. When i go like that:
em.persist(film);
em.flush();
em.refresh(film);

then i get:
javax.ejb.EJBException: null; CausedByException is:
No row with the given identifier exists: [pl.com.filmservice.par.Film#463]

I would appreciate any help.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914056#3914056

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914056


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to