Hi

are you able to extract it in a small maven project you can share on
github?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-10-28 13:16 GMT+01:00 tgp <[email protected]>:

> Hi everybody,
>
> I’m doing a migration of a webapp  which uses EJB 2.1 and CMP from Weblogic
> to Tomee 1.7.2.
>
> After rewriting the ejb-jar.xml and doing the right mapping with the
> database in the orm.xml the server works quite well on everything regarding
> SELECTS and so on, but when I try to create a Bean to be inserted in the
> database I get the OutOf Memory - Java Heap error.
>
> Everything, until now, has gone more or less alright but now I’m in one
> point I’m blocked and I’m not sure on how to continue.
>
> I’ve done debug on the OpenEJB sources and I’ve found the cause is in the
> bean which is being created, in the ejbPostCreate, when it tries to assign
> a
> variable which is another bean.
>
>         /**
>          * The container invokes this method immediately after it calls
> ejbCreate.
>          */
>         public void ejbPostCreate(...)
>                 throws javax.ejb.CreateException {
>
>                 this.setArticle(article); //The out of memory error is
> right here
>
>                 ...
>                 }
>
> From the log I can get the SELECT query that’s is run in the database for
> assigning that bean and it returns ~700.000 rows so, my guess is that the
> server tries to create all of those objects and that’s why I get that
> OutOfMemoryError (it takes a while until I get the error).
>
> If I comment that line and all the set inside of ejbPostCreate it works,
> but
> latter I get quite a lot of NullPointerExceptions because the variables
> haven't been initialized.
>
> I’ve set the memory limit to 512Mb and also I’ve also tried to set all the
> relations with fetch=LAZY but without success.
>
> Any ideas on what can be the problem? Is the approach of doing the
> this.setArticle(...) inside the ejbPostCreate correct or it's deprecated?
>
> Thank you very much for any help or advice you could give me.
>
> Tomás
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Problem-with-Tomee-on-ejbPostCreate-method-OutOfMemoryError-tp4676642.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Reply via email to