Re: [sqlite] cannot set connection while a datareader is active
Il 21/04/2014 22.03, rava ha scritto: I know, you have all code wich is involved in the error... for the parte involved, no other function was called... i call executereader only for one datareader and two Times directly to the command... do you found the other datareader in the sent code? If exist it have to be in the sent code, but i don't see nothing.. you could? Joe Mistachkin ha scritto: Stefano Ravagni wrote: Thanks for answer Joe, but as just sayed i have only one datareader, That is not possible. There must be at least two different data reader instances because the references in the watch window did not match. Every time you call ExecuteReader, a brand new data reader is returned. Keeping track of these returned data readers is very important because they must all be properly disposed at some point. i'm sure of that, and this is demostrated because with others provider i have not error. Perhaps the other providers do not have a restriction on resetting the underlying connection for a command when data readers are active. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Joe, i finally solve the error following your advices... We search for a Datareader object, but we could not find There are (as i sayed) only one datareader object as declared object but thinking about your words when you saw ("Every time you call ExecuteReader, a brand new data reader is returned.") i check for a call to ExecuteReader WITHOUT association for DATI object (Datareader). I found this line in a function wich load a Checklist ... frmAutomazione.SorgenteAutomazioni.DataSource = objCmd.ExecuteReader This line goes out of what i've searched forbut one time i change this code, all goes good!!! So, i'm sorry for my insistence, but finally with your help i became able to find the problem and adjust it !!! Thank you Thank you Thank you Thank you very much !!! I would to make a little donation to your workexist a way ?? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 21/04/2014 21.54, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Thanks for answer Joe, but as just sayed i have only one datareader, That is not possible. There must be at least two different data reader instances because the references in the watch window did not match. Every time you call ExecuteReader, a brand new data reader is returned. Keeping track of these returned data readers is very important because they must all be properly disposed at some point. i'm sure of that, and this is demostrated because with others provider i have not error. Perhaps the other providers do not have a restriction on resetting the underlying connection for a command when data readers are active. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Hello Joe, i forgot to tell you what to do for see the errorwhen checklist appear, click on ANNULLA button...after somes cicles it will appear... I know what you say, but you have all code wich is involved in the error... for the parte involved, no other function was called... i call executereader only for one datareader and two only times directly to the command... do you found the other datareader in the sent code? If exist it have to be in the sent code, but i don't see nothing.. you could? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
I know, you have all code wich is involved in the error... for the parte involved, no other function was called... i call executereader only for one datareader and two Times directly to the command... do you found the other datareader in the sent code? If exist it have to be in the sent code, but i don't see nothing.. you could? Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> Thanks for answer Joe, but as just sayed i have only one datareader, >> > >That is not possible. There must be at least two different data reader >instances because the references in the watch window did not match. >Every time you call ExecuteReader, a brand new data reader is returned. >Keeping track of these returned data readers is very important because >they must all be properly disposed at some point. > >> >> i'm sure of that, and this is demostrated because with others provider >> i have not error. >> > >Perhaps the other providers do not have a restriction on resetting the >underlying connection for a command when data readers are active. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Thanks for answer Joe, but as just sayed i have only one datareader, > That is not possible. There must be at least two different data reader instances because the references in the watch window did not match. Every time you call ExecuteReader, a brand new data reader is returned. Keeping track of these returned data readers is very important because they must all be properly disposed at some point. > > i'm sure of that, and this is demostrated because with others provider > i have not error. > Perhaps the other providers do not have a restriction on resetting the underlying connection for a command when data readers are active. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Thanks for answer Joe, but as just sayed i have only one datareader, i'm sure of that, and this is demostrated because with others provider i have not error. Try please changing the first lines of code in frmprincipale.vb form as explained for match access database... you Will not have error... why this if not a provider error? Otherwise, what have i to do in tour mind? Thanks Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> i've built a very little application wich could reprocude the "CANNOT SET >> CONNECTION WHILE DATAREADER IS ACTIVE" error. >> > >I've run the project with Visual Studio 2013 and determined that the >exception >being raised is almost certainly not an issue with System.Data.SQLite, per >se. > >At the point of the exception, I used the following watch expression: > > >DirectCast(objCmd,System.Data.SQLite.SQLiteCommand)._activeReader.Target Is >Dati > >This returns false, indicating that while the SQLiteCommand object does >indeed >have an active data reader, it is NOT the one that was closed just above >that >point in the code. I'm not sure how the project manages data reader >instances; >however, it would appear that System.Data.SQLite is throwing exceptions just >as >it should in this case. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > i've built a very little application wich could reprocude the "CANNOT SET > CONNECTION WHILE DATAREADER IS ACTIVE" error. > I've run the project with Visual Studio 2013 and determined that the exception being raised is almost certainly not an issue with System.Data.SQLite, per se. At the point of the exception, I used the following watch expression: DirectCast(objCmd,System.Data.SQLite.SQLiteCommand)._activeReader.Target Is Dati This returns false, indicating that while the SQLiteCommand object does indeed have an active data reader, it is NOT the one that was closed just above that point in the code. I'm not sure how the project manages data reader instances; however, it would appear that System.Data.SQLite is throwing exceptions just as it should in this case. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
HEllo Joe, i've built a very little application wich could reprocude the "CANNOT SET CONNECTION WHILE DATAREADER IS ACTIVE" error. While extracting data and populate a checklist, you could see the error...just launch the project. I've putted block debug point in a function called "EstraiDatiAlVoloAutomation" where you could found the point were the code go in error after somes passages... sometimes at the first, somes others in second or after... If you observe the code you could see it say datareader is active when dati.isclosed say TRUE... In the "frmPrincipale.vb" form you can set the code to run under ACCESS version simply changing 2 string, and you can see it not generate this error, as not generate in many other database system... Becaus of "slimming" a big source code, consider maybe you could encounter somes others error which have not to say with the problem i ask solutioni'm sorry for that, i tryed to make a slim project for reproduce error only... A put a RAR archive with the slim project at this link: https://www.dropbox.com/s/bugysawir52ivna/TestSQLite.rar 2014-04-20 6:00 GMT+02:00 Joe Mistachkin : > > Stefano Ravagni wrote: > > > > Is a big project wich re-call many function and interacts many times > > with sqlite provider... i could try to isolate a piece of code but > > isolating the code i don't know if the error will be reproduced...but i > > will try is all VB codeare you interested to receive a ZIP file > > containing a little piece of code with also database ? Or exist another > > way to find the error in your mind ? > > Thanks for answer!!! > > > > It would be great if you could come up with an isolated body of code that > demonstrates the issue. Since this mailing list strips attachments, you > could post a link to a ZIP file that can be downloaded. > > -- > Joe Mistachkin > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 20/04/2014 6.00, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Is a big project wich re-call many function and interacts many times with sqlite provider... i could try to isolate a piece of code but isolating the code i don't know if the error will be reproduced...but i will try is all VB codeare you interested to receive a ZIP file containing a little piece of code with also database ? Or exist another way to find the error in your mind ? Thanks for answer!!! It would be great if you could come up with an isolated body of code that demonstrates the issue. Since this mailing list strips attachments, you could post a link to a ZIP file that can be downloaded. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Ok Joe, i'll try to prepare in next days i don't know if i will able to isolate but i'll write to you soon (i hope). Thanks for now and good holydays... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Is a big project wich re-call many function and interacts many times > with sqlite provider... i could try to isolate a piece of code but > isolating the code i don't know if the error will be reproduced...but i > will try is all VB codeare you interested to receive a ZIP file > containing a little piece of code with also database ? Or exist another > way to find the error in your mind ? > Thanks for answer!!! > It would be great if you could come up with an isolated body of code that demonstrates the issue. Since this mailing list strips attachments, you could post a link to a ZIP file that can be downloaded. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 19/04/2014 20.12, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Joe have you somes help advice for my case ? I don't receive your answer from 3 days... I'm still unable to reproduce the behavior you describe here locally. Are you able to post all the code that interacts with System.Data.SQLite? That might help me to narrow down exactly what caused the SQLiteCommand to get into a state where the connection cannot be reset. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Is a big project wich re-call many function and interacts many times with sqlite provider... i could try to isolate a piece of code but isolating the code i don't know if the error will be reproduced...but i will try is all VB codeare you interested to receive a ZIP file containing a little piece of code with also database ? Or exist another way to find the error in your mind ? Thanks for answer!!! ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Joe have you somes help advice for my case ? I don't receive your answer > from 3 days... > I'm still unable to reproduce the behavior you describe here locally. Are you able to post all the code that interacts with System.Data.SQLite? That might help me to narrow down exactly what caused the SQLiteCommand to get into a state where the connection cannot be reset. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 16/04/2014 22.33, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Joe i cannot find the way for follow the command object properties you saycould you tell me what and how to observe exactly please ? You might need to add the System.Data.SQLite project(s) to the solution in order to be able to see full debugging information for them. I recommend adding the "System.Data.SQLite.20XX.csproj" and "SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of Visual Studio you are using. Then, you'll want to reset the reference to point to the project instead of the built assembly. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Joe have you somes help advice for my case ? I don't receive your answer from 3 days... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 16/04/2014 22.33, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Joe i cannot find the way for follow the command object properties you saycould you tell me what and how to observe exactly please ? You might need to add the System.Data.SQLite project(s) to the solution in order to be able to see full debugging information for them. I recommend adding the "System.Data.SQLite.20XX.csproj" and "SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of Visual Studio you are using. Then, you'll want to reset the reference to point to the project instead of the built assembly. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Joe, today i tryed Devart SQLite DotConnect and i have not this problem... From last week, i made many tests on my code, but remain one fact i have this problem only with Sqlite .net library... I use only one datareader and is not possible it say me that i have one datareader active when debugger say me datareader is closed (as you seen)... I think with more force that could be an error in your datareader check routine that cause this problem but i'm not able to demostrate to you... Think you we could try to solve togheter ? Could be a particular sql query to generate this error ? I'm not able to make test including project, i never do this and i don't know how to do... I like to integrate your library in my project but i have to resolve this strange errorThanks for your patience... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Ops... i'm not able to do this, never used first and don't know c# so well to understand the project. Can i try somes others way from my project?? Have you idea about why with the same code the sqlite provider is the only wich give me this error? Could depend from a query ? But i don't obtain visible error passing query from a gui database external software, just tested ... Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> Joe i cannot find the way for follow the command object properties you >> saycould you tell me what and how to observe exactly please ? >> > >You might need to add the System.Data.SQLite project(s) to the solution in >order >to be able to see full debugging information for them. > >I recommend adding the "System.Data.SQLite.20XX.csproj" and >"SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of >Visual >Studio you are using. > >Then, you'll want to reset the reference to point to the project instead of >the >built assembly. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Joe i cannot find the way for follow the command object properties you > saycould you tell me what and how to observe exactly please ? > You might need to add the System.Data.SQLite project(s) to the solution in order to be able to see full debugging information for them. I recommend adding the "System.Data.SQLite.20XX.csproj" and "SQLite.Interop.20XX.vc[x]proj" projects that correspond to the version of Visual Studio you are using. Then, you'll want to reset the reference to point to the project instead of the built assembly. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 14/04/2014 21.12, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Hello Joe, tryed to change the code in the IF expression but nothing change I would ask if you seen the screenshot i attached somes days ago because it show what happen From debugger Datareader result CLOSED and HasRows properties result NO ROWS, but i obtain the error wich say datareader is open ! The error happen at line were i set command connection properties as in the code above... Try Call CloseDati() ' which call Dati.Close() objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** objCmd.CommandText = strSQLvar Dati = objCmd.ExecuteReader() ... The only thing that I can think of is that somehow the data reader being closed is not the same one associated with the command you are attempting to set the connection of. Are you 100% sure that the "Dati" data reader is associated with the "objCmd" command? -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users I am thinking about one thing System.Data.Sqlite.Dll have abilities to return Multiple result sets or not ? could be this the motivation because SQlite is the only database who get me this error ? ... or this abilities is already supported ? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 14/04/2014 21.12, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Hello Joe, tryed to change the code in the IF expression but nothing change I would ask if you seen the screenshot i attached somes days ago because it show what happen From debugger Datareader result CLOSED and HasRows properties result NO ROWS, but i obtain the error wich say datareader is open ! The error happen at line were i set command connection properties as in the code above... Try Call CloseDati() ' which call Dati.Close() objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** objCmd.CommandText = strSQLvar Dati = objCmd.ExecuteReader() ... The only thing that I can think of is that somehow the data reader being closed is not the same one associated with the command you are attempting to set the connection of. Are you 100% sure that the "Dati" data reader is associated with the "objCmd" command? -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Joe i cannot find the way for follow the command object properties you saycould you tell me what and how to observe exactly please ? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Hello Joe, i'm here for try but i cannot find how to test _activeReader method as you say...could you tell me how to test it? 2014-04-15 10:19 GMT+02:00 rava : > How could i do this? By debugging and adding a watch to the object? > > > > Joe Mistachkin ha scritto: > > > > Stefano Ravagni wrote: > > > > So what have i do? Need to see others setting or state? > > > > It would be useful to try and examine the internal state of the > SQLiteCommand and see if the _activeReader member is valid. If > it is valid, see if it actually refers to the data reader you > are using. > > -- > Joe Mistachkin > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
How could i do this? By debugging and adding a watch to the object? Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> So what have i do? Need to see others setting or state? >> > >It would be useful to try and examine the internal state of the >SQLiteCommand and see if the _activeReader member is valid. If >it is valid, see if it actually refers to the data reader you >are using. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > So what have i do? Need to see others setting or state? > It would be useful to try and examine the internal state of the SQLiteCommand and see if the _activeReader member is valid. If it is valid, see if it actually refers to the data reader you are using. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
So what have i do? Need to see others setting or state? If yes how? Could be a problem solved with a New compilation of dll? The strange thing is it happen sometimes in one passage, sometimes in another of proposero function. Could be generated by execution of particular sql query with date field? Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> Can i send you a screenshot where you could see with your eyes my debug >> situation ? So you could observe it cannot say there is a datareader >> active and in the same time show that datareader is closed... >> > >I've seen the screenshot; however, it does not show the internal state of >the SQLiteCommand object throwing the exception. When the Close() method >of the SQLiteDataReader is called, it should end up calling ClearDataReader >on the associated SQLiteCommand. In this case, that may not be happening. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Can i send you a screenshot where you could see with your eyes my debug > situation ? So you could observe it cannot say there is a datareader > active and in the same time show that datareader is closed... > I've seen the screenshot; however, it does not show the internal state of the SQLiteCommand object throwing the exception. When the Close() method of the SQLiteDataReader is called, it should end up calling ClearDataReader on the associated SQLiteCommand. In this case, that may not be happening. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 14/04/2014 0.22, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Hello Joe, here my code for CloseDati to help you to reproduce the error that i don't understand... ++ Public Sub CloseDati() 'chiude i dati del datareader associati all'oggetto DATI cui ' spesso sono attaccati anche altri oggetti come ' l'oggetto ObjCmd Try If IsNothing(Dati) = False Then If Dati.IsClosed = False Then Dati.Close() End If Catch ex As Exception Call ScriviLog("ModConnessione.CloseDati", ex.Message) MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf & vbCrLf & ex.Message) End Try End Sub Just seen the image attachment i sent which demostrate i obtain the error ? I'm still unable to reproduce the issue. Is an exception being caught by this method while trying to close the data reader? Also, perhaps instead of using the IsNothing function, you might want to change the "If" expression to: If Not Dati Is Nothing Then In theory, changing the "If" expression should not make any difference; however, I seem to recall that the IsNothing function was typically used for checking the sub-type of a Variant (i.e. and not for checking for null references). Of course, I have not used Visual Basic.NET for quite a long time and I may be wrong. -- Joe Mistachkin ___ sqlite-users mailing list Hello Joe, tryed to change the code in the IF expression but nothing change I would ask if you seen the screenshot i attached somes days ago because it show what happen From debugger Datareader result CLOSED and HasRows properties result NO ROWS, but i obtain the error wich say datareader is open ! The error happen at line were i set command connection properties as in the code above... Try Call CloseDati() ' which call Dati.Close() objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** objCmd.CommandText = strSQLvar Dati = objCmd.ExecuteReader() ... -- sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 14/04/2014 21.12, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Hello Joe, tryed to change the code in the IF expression but nothing change I would ask if you seen the screenshot i attached somes days ago because it show what happen From debugger Datareader result CLOSED and HasRows properties result NO ROWS, but i obtain the error wich say datareader is open ! The error happen at line were i set command connection properties as in the code above... Try Call CloseDati() ' which call Dati.Close() objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** objCmd.CommandText = strSQLvar Dati = objCmd.ExecuteReader() ... The only thing that I can think of is that somehow the data reader being closed is not the same one associated with the command you are attempting to set the connection of. Are you 100% sure that the "Dati" data reader is associated with the "objCmd" command? -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Yes Joe, DATI is the only Datareader in my projecti have no others datareader in use...is why i cannot understand... Can i send you a screenshot where you could see with your eyes my debug situation ? So you could observe it cannot say there is a datareader active and in the same time show that datareader is closed... The thing i cannot understand is why it happen only in SQliteif was my development bug it have to show on all database, don't think you ? I'm desperate... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Hello Joe, tryed to change the code in the IF expression but nothing > change > I would ask if you seen the screenshot i attached somes days ago because > it show what happen > > From debugger Datareader result CLOSED and HasRows properties result NO > ROWS, but i obtain the error wich say datareader is open ! > > The error happen at line were i set command connection properties as in > the code above... > > Try > Call CloseDati() ' which call Dati.Close() > > objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** > objCmd.CommandText = strSQLvar > Dati = objCmd.ExecuteReader() > ... > The only thing that I can think of is that somehow the data reader being closed is not the same one associated with the command you are attempting to set the connection of. Are you 100% sure that the "Dati" data reader is associated with the "objCmd" command? -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
On 14 Apr 2014 at 15:14, Stefano Ravagni wrote: > I would ask if you seen the screenshot i attached somes days ago because > it show what happen Attachments are not allowed here. tim. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Il 14/04/2014 0.22, Joe Mistachkin ha scritto: Stefano Ravagni wrote: Hello Joe, here my code for CloseDati to help you to reproduce the error that i don't understand... ++ Public Sub CloseDati() 'chiude i dati del datareader associati all'oggetto DATI cui ' spesso sono attaccati anche altri oggetti come ' l'oggetto ObjCmd Try If IsNothing(Dati) = False Then If Dati.IsClosed = False Then Dati.Close() End If Catch ex As Exception Call ScriviLog("ModConnessione.CloseDati", ex.Message) MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf & vbCrLf & ex.Message) End Try End Sub Just seen the image attachment i sent which demostrate i obtain the error ? I'm still unable to reproduce the issue. Is an exception being caught by this method while trying to close the data reader? Also, perhaps instead of using the IsNothing function, you might want to change the "If" expression to: If Not Dati Is Nothing Then In theory, changing the "If" expression should not make any difference; however, I seem to recall that the IsNothing function was typically used for checking the sub-type of a Variant (i.e. and not for checking for null references). Of course, I have not used Visual Basic.NET for quite a long time and I may be wrong. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Hello Joe, tryed to change the code in the IF expression but nothing change I would ask if you seen the screenshot i attached somes days ago because it show what happen From debugger Datareader result CLOSED and HasRows properties result NO ROWS, but i obtain the error wich say datareader is open ! The error happen at line were i set command connection properties as in the code above... Try Call CloseDati() ' which call Dati.Close() objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR *** objCmd.CommandText = strSQLvar Dati = objCmd.ExecuteReader() ... ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Thanks for answer. Today i'll try to update my code as you say and i'll feedback the result. However i don't think is a solution because just tried to use a line of code simplest as possibile,like only "datareader.close()" but still not work. The error is catched not during datareader close method, but after, when i call "objcommand.connection equal objconnection"... here start error, but debugger say datareader isclosed as in attached image i sent ...(but where is the attached image i sent??? I don't see today) Joe Mistachkin ha scritto: > >Stefano Ravagni wrote: >> >> Hello Joe, here my code for CloseDati to help you to reproduce the error >> that i don't understand... >> >> ++ >> Public Sub CloseDati() >> >> 'chiude i dati del datareader associati all'oggetto DATI cui >> ' spesso sono attaccati anche altri oggetti come >> ' l'oggetto ObjCmd >> Try >> If IsNothing(Dati) = False Then >> If Dati.IsClosed = False Then Dati.Close() >> End If >> Catch ex As Exception >> Call ScriviLog("ModConnessione.CloseDati", ex.Message) >> MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf >& vbCrLf & ex.Message) >> End Try >> End Sub >> >> Just seen the image attachment i sent which demostrate i obtain the error >? >> > >I'm still unable to reproduce the issue. Is an exception being caught by >this >method while trying to close the data reader? Also, perhaps instead of >using >the IsNothing function, you might want to change the "If" expression to: > > If Not Dati Is Nothing Then > >In theory, changing the "If" expression should not make any difference; >however, >I seem to recall that the IsNothing function was typically used for checking >the >sub-type of a Variant (i.e. and not for checking for null references). Of >course, >I have not used Visual Basic.NET for quite a long time and I may be wrong. > >-- >Joe Mistachkin > >___ >sqlite-users mailing list >sqlite-users@sqlite.org >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Hello Joe, here my code for CloseDati to help you to reproduce the error > that i don't understand... > > ++ > Public Sub CloseDati() > > 'chiude i dati del datareader associati all'oggetto DATI cui > ' spesso sono attaccati anche altri oggetti come > ' l'oggetto ObjCmd > Try > If IsNothing(Dati) = False Then > If Dati.IsClosed = False Then Dati.Close() > End If > Catch ex As Exception > Call ScriviLog("ModConnessione.CloseDati", ex.Message) > MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf & vbCrLf & ex.Message) > End Try > End Sub > > Just seen the image attachment i sent which demostrate i obtain the error ? > I'm still unable to reproduce the issue. Is an exception being caught by this method while trying to close the data reader? Also, perhaps instead of using the IsNothing function, you might want to change the "If" expression to: If Not Dati Is Nothing Then In theory, changing the "If" expression should not make any difference; however, I seem to recall that the IsNothing function was typically used for checking the sub-type of a Variant (i.e. and not for checking for null references). Of course, I have not used Visual Basic.NET for quite a long time and I may be wrong. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > The code run from 4 years over Access, MySql, PostgreSQL and no trace > about a similar error or datareader still open message. > So i'm confused using SQlite and receive this error. > > I confirm that i use only one datareader in the project, and while > receive error debugger say me datareader is closed, as you can see in > screenshot attacched in this mail. > > Please help me i would like to implement the use of SQlite in my > project and i have to solve this error. > In order to be able to further diagnose this issue, I'll need to see the code for the "CloseDati" routine. This is necessary because I am unable to reproduce the issue thus far. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > Hello, i use this code for a function wich run in all database except > Sqlite.. > I've written a test case and added some comments to the ticket, here: http://system.data.sqlite.org/index.html/info/d0116ee2c3 Meanwhile, could you please post the code for the "CloseDati" routine? -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] cannot set connection while a datareader is active
Stefano Ravagni wrote: > > "cannot set connection while a datareader is active" but nothing apparent > cause this bahavior Is a knowed error message tha i could fix ? > The only way to obtain this error message is to attempt to set the Connection property of a SQLiteCommand object while an active data reader is attached to it. Normally, the Connection property of the SQLiteCommand object should not need to be set. I'm somewhat curious why it needs to be set in this case. -- Joe Mistachkin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] cannot set connection while a datareader is active
Hello, i have a problem with SQlite and i would ask if someone had solved it. I obtain this error: "cannot set connection while a datareader is active" but nothing apparent cause this bahavior Is a knowed error message tha i could fix ? If i drive slow execution of code debugging it and wait somes minutes, all run...it seems as a temp lock...is possible ? I use connection with option "Flags=StickyHasRows" ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users