I am not quite sure, but for each entity bean two objects are always
created:
- remote EJB object
- object with your bussines logic.

I think that only second one is subject to pooling - so maybe you can be out
of memory because of large amounts of remote instances. This problem you are
facing to brings me again the question about  the sense of entity beans.
Regards
Petr

-----Original Message-----
From: Sven van 't Veer <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Date: 28. listopadu 2000 15:37
Subject: Huge amounts of entities, no pooled instances


>Yesterday I posted a question about batch updating in Orion. Orion is
>creating huge amounts of instances of my entity without pooling.
>
>Someone mentioned that my updates possibly would be inside the same TX.
>Actually I'm using updating 2 tables, in one table, There is only 1
>entity ised and it's pooled, the other one creates huge amounts of
>entities. (One for each line in my file, there are some 200000 lines to
>each file and sometimes a Deadlock occurs due to an
>OutOfMemoryException).
>I have now set the Tx attribute to my update and remove methods to
>RequiresNew, but still one bean is creating huge amounts of Beans while
>the other is pooling.
>
>Here's the updater method of my session bean:
>  public boolean update(ContaEncerradaModel m, String nome){
>    boolean result = false;
>    try{
>      try{
>        Ccf ccf = ccfHome.findByPrimaryKey(new CcfPK(m.getCgcCpf(),
>m.getBanco(), m.getAg()));
>        ccf.setQt(m.getQty());
>        ccf.setDate(m.getDate());
>        result = true;
>      } catch (FinderException ex){ // if we cant find it we need to
>create it
>        try{
>          ccfHome.create(m.getCgcCpf(), m.getBanco(), m.getAg(),
>m.getQty(), m.getDate());
>          result = true;
>        } catch (CreateException exc){
>          result = false;
>        }
>      }
>      try{ // no need to set result in this block, since we anly want to
>know about ccf
>//
>here's where only one instance is created, it's activated and passivated
>constantly.
>the CCF part however keeps creating instances without passifating.
>//
>        nHome.create(m.getCgcCpf(), nome);
>      } catch (CreateException ex){ //this probably means we already
>have the name, so forget it
>      }
>    } catch (Exception ex){
>      System.out.println(ex.toString());
>    } finally {
>      return result;
>    }
>  }
>--
>===========================================================================
===========
>Sven E. van 't Veer
>http://www.cachoeiro.net
>Java Developer             [EMAIL PROTECTED]
>===========================================================================
===========


Reply via email to