Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network error when reconnecting to database. #86

Open
rowland opened this issue Dec 15, 2011 · 0 comments
Open

Network error when reconnecting to database. #86

rowland opened this issue Dec 15, 2011 · 0 comments

Comments

@rowland
Copy link

rowland commented Dec 15, 2011

After connecting to and disconnecting from a database and a period of inactivity, reconnecting triggers this error:

System.ObjectDisposedException: Cannot access a disposed object.
at System.Net.Sockets.TcpClient.GetStream()
at Norm.Connection.GetStream() in x:\dev.net\lib\NoRM\NoRM\Connections\Connection.cs:line 133
at Norm.Connection.Write(Byte[] bytes, Int32 start, Int32 size) in x:\dev.net\lib\NoRM\NoRM\Connections\Connection.cs:line 164
at Norm.Protocol.Messages.QueryMessage2.Execute() in x:\dev.net\lib\NoRM\NoRM\Protocol\Messages\QueryMessageGeneric.cs:line 100 at Norm.MongoQueryExecutor2.d__0.MoveNext() in x:\dev.net\lib\NoRM\NoRM\MongoQueryExecutor.cs:line 57
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at Norm.Collections.MongoCollection1.FindOne[U](U template) in x:\dev.net\lib\NoRM\NoRM\Collections\MongoCollectionGeneric.cs:line 214

I suspect a network connection remained after "disconnecting" due to connection pooling being enabled, but the connection was likely severed by our firewall due to inactivity. Upon "reconnecting," the first request triggers the error above.

Unfortunately, disabling connection pooling leads to nasty errors much earlier and without the periods of inactivity.

I upgraded NoRM to the latest because I spotted an update awhile back that looks like it might solve this issue, but apparently that's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant