Hi,

Could it simply be that an exception -that is catched at higher level- is thrown in broker.insert(Object obj); ? in that case the transaction is never commited and the broker never closed.

The following code would then solve the problem:

PersistenceBroker broker = null;
try
{
broker = PersistenceBrokerFactory.defaultPersistenceBroker();



broker.beginTransaction();

broker.insert(Object obj);


broker.commitTransaction();

}
finally
{

if(broker!=null)
{
broker.close();
}
}



HTH,


Alexandre BORGOLTZ
Head of Technology

SmartJog SA
Phone: +33 (0)1 4996 6324
Fax: +33 (0)1 4996 6405
Mobile: +33 (0)6 8882 1417
[EMAIL PROTECTED]


Jakob Braeuchi wrote:

>
>
> Subject: Problem in Releasing Connection
> From: Sudhir Kumar <[EMAIL PROTECTED]>
> Date: Wed, 14 Sep 2005 14:56:27 -0600
> To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
>
> Hi,
>
> I am using OJB in our project. We are using oracle 10g as a database.
>
> I am using the following steps to retrieve/insert records the data from the tables
>
>
> PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
> broker.beginTransaction();
> broker.insert(Object obj);
> broker.commitTransaction();
> broker.close();
>
> We have a utility which runs on every 10 sec. and after few minutes we are getting an error that “Unable to get object from connection pool”
>
> I suspect that by using this way the connection is not released and it is not returning to pool.
>
> Can u suggest me how to close the connection and return the connection to pool.
>
> Any help will be highly appreciated. Thanks for helping.
>
> Thanks and regards,
>
> Sudhir Kumar
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to