[jboss-user] [EJB 3.0] - Large data insert generates no line at database

abra20 do-not-reply at jboss.com
Wed Oct 11 08:35:13 EDT 2006


Im facing a problem and Im completely lost at it.

I get the file through JSF component.
What I have to do is read the file, line by line instantianting a new Entity that will have 
this String as an attribute. So, I create a List of the entities created.

List list = new ArrayList();
   EntityB b = new EntityB();
   b.value = line;


Also, I have another Entity that will receive this List.

EntityA a = em.getEntityA(id);

Finally, I try to merge EntityA, as I use cascade, EntityB will also be persisted.


First problem:
What is the best way of passing the file or its content to my SessionBean(Stateless)
so I can iterate the content and persist it?

What Im doing is read the UploadedFile (Adf Component) and write the content to a java.io.File,
so I can pass it to the SessionBean but I dont think this is a good thing because these uploaded
files are about 50 - 150 thounsand lines.

Second problem:
How do I persist those thousands of entities objects I created?
I call em.persist and none is persisted.
I tried to insert through native query and also no line is inserted.

However when I try a smaller File with 15 thousand lines, the task is successfully done.

Appreciate some help!


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

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

More information about the jboss-user mailing list