Hello!
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();
while((line=reader.readLine)!=null)
{
EntityB b = new EntityB();
b.value = line;
list.add(b);
}
Also, I have another Entity that will receive this List.
EntityA a = em.getEntityA(id);
a.setBEntities(list);
Finally, I try to merge EntityA, as I use cascade, EntityB will also be
persisted.
em.merge(a);
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!
Thanks!
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
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user