[odb-users] Re: memory leak

黄川 buptstehc at gmail.com
Tue Jan 14 03:15:41 EST 2014


i have tried by resusing the transaction instance like this:
odb::transaction::current (*t_);
db_->execute(sql);
t_->commit();
t_->reset(db_->begin());

but the handles is still increasing.


2014/1/14 黄川 <buptstehc at gmail.com>

> sorry, the code should be this:
> odb::transaction t (db_->begin());
> db_->execute(sql);
> t.commit();
>
>
>
>
> 2014/1/14 黄川 <buptstehc at gmail.com>
>
>> Hi,all! when i test inserting data multiple times , the handles occupied
>> by my program is increasing from process manager in windows, my code is as
>> follows:
>>
>> odb::transaction t (db_->begin());
>> db_->persist(m);
>> db_->execute(sql);
>> t.commit();
>>
>> since every time when i insert a new data, i will create a new
>> transaction t, i want to know whether i can create this once and reuse
>> over and over again?thanks!
>>
>
>


More information about the odb-users mailing list