Re: [sqlite] SQLite, .Net and Datareader: Close method is too slow.
*Mário Cardia wrote:* > Solved: > > The Method Close of the Datareader was slow because it was inside a > try-catch. > I remove de try-catch and it´s ok now. The SQLiteDataReader class, properly implementing the IDataReader interface, exposes and relies upon proper use of the IDispose interface. In general, objects exposing IDispose should be created and disposed using C# 'using' construct or its equivalent in whatever CLR-targeted language you are using. This would likely also fix your slowness issue, and would ward off other difficulties that are likely to arise in your use of these objects. You should perhaps read about IDispose and the usage patterns recommended for classes which need to implement it. Several classes in SQLite.NET, because they allocate resources needing more deterministic release than the .NET garbage collector can provide, are best used with the 'using' construct. Best regards, -- Larry Brasfield ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLite, .Net and Datareader: Close method is too slow.
Solved: The Method Close of the Datareader was slow because it was inside a try-catch. I remove de try-catch and it´s ok now. []'s Mário Cardia 2013/8/27 Mário Cardia> > Hi, > > I'm have a batch proccess that reads from many datareaders. > > When I finished with de datareader I call the close() method. > > This is too slow. If I don´t close the data reader, the application runs > in 0.4ms > If I close the datareader, the application runs in 26 seconds. > > Does anybody has a tip in how to solve this problem? > > There are many datareaders in sub routines. I´m afraid that not closing > them I will keep trash in memory. > > > []'s > > Mário Cardia > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLite, .Net and Datareader: Close method is too slow.
Hi, I'm have a batch proccess that reads from many datareaders. When I finished with de datareader I call the close() method. This is too slow. If I don´t close the data reader, the application runs in 0.4ms If I close the datareader, the application runs in 26 seconds. Does anybody has a tip in how to solve this problem? There are many datareaders in sub routines. I´m afraid that not closing them I will keep trash in memory. []'s Mário Cardia ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users