I have a CMP Entity bean which I am using in the following code

Collection coll = nsHome.findAll();
Iterator it = coll.iterator();
out.println(coll.size()+" Entries found<br>"); //1600 entries
out.flush();
int cnt = 1;
while (it.hasNext())
{
try
{
sapRemote = null;
sapRemote = sapHome.findByPrimaryKey(new
Ipims_drows_sapPK(nsRemote.getLogin_id(),pass_enc
(nsRemote.getPassword())));
out.println(nsRemote.getLogin_id()+" Exists<br>");
out.flush();
}
catch (FinderException fe)
{
sapRemote = sapHome.create(new
Ipims_drows_sapPK(nsRemote.getLogin_id(),pass_enc
(nsRemote.getPassword())));
}
}

It Seems that sapRemote is not releasing connections when I iterate through
the Collection. As soon as I hit record 50 i get the following SQLException

SQL Error opening DataSource: Timed out waiting for an available connection
after 60 second (connection pool reached max-connections which was set to
50);

How can I make CMP entities release there connections after i've set them to
null?
I cleared the database so that none of the records existed (IE a
FinderException was thrown)

in the catch clause I performed a remote.create and created the record and
all 1600 updates performed flawlessly

So for some reason Finders are keeping connection but creates are not

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to