I'm new to all this, but from looking at your code the only significant
difference I see is that the second try block has a finally after it and the
first one doesn't.  Perhaps it's a bug [in Orion] and perhaps not, but maybe
it doesn't passivate without a finally?  Or maybe it needs a catch to notice
that it needs to passivate.  I just see that the VERY first try block in
your code doesn't have either one after it.

Alan
----- Original Message -----
From: Sven van 't Veer <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Sent: Tuesday, November 28, 2000 7:45 AM
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){ file://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