C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

corrupt datasets when using object pooling and no webform

rated by 0 users
This post has 6 Replies | 0 Followers

Not Ranked
Posts 4
cswanberg Posted: Tue, Mar 6 2007 10:47 AM
Hi,

We use classes to encapsulate certain c1 code, e.g. adding filters and filling using sessioncache. In the course of normal debugging, we noticed an odd problem.

If we got a dataset error, e.g. a Foreign Key constraint, the dataset became corrupt. Any subsequent request to the page tried would use the same worker object in the object pool which would return a 2nd error, which now is an expression error. This error is kind of a red herring. In the debugger you will get this error with the brand new dataset from the pool even if you just try to reference TableViews.Count or HasErrors. Even if you Clear() the dataset, you still get this expression error no matter what. In my opinion, it is corrupt at this point. We nailed this down to the object pool by turning pooling off. When we do this, we get the initial FK error every time we load the page. Which is the expected behavior because we truly have a FK error that we need to debug. When the dataset is corrupt, that worker object is corrupt for any request, for any session. That is obviously not ideal.

The next wrinkle is that in trying to debug this, we learned that if we delay the error by turning contrainst off and on that if we turn contraints on in our special "helper" class the dataset becomes corrupt. But, if we turn constraints back on from the webform itself, everything works fine. This is pretty odd, and makes me think that internal code must be using reflection or something to reference the current class? And because it is our helper class and not a webform, there is a problem. Does this make sense?

Any ideas on how we might make this work? I tried a quick experiment making our helper class inherit from webcontrol. That didn't seem to help either.

Thanks... Chuck
Top 10 Contributor
Posts 1,645
Hi Chuck,

What version of C1WebData are you using? Also, what versions
of .NET Framework and Visual Studio are on your machine?

I'll try to see into this problem later this week.

> The next wrinkle is that in trying to debug this, we learned that if we
> delay the error by turning contrainst off and on that if we turn contraints
> on in our special "helper" class the dataset becomes corrupt. But, if we
> turn constraints back on from the webform itself, everything works fine.
> This is pretty odd, and makes me think that internal code must be using
> reflection or something to reference the current class?

We don't use reflection here. That's probably some another issue.

BTW why are you still using C1WebData? From my personal standpoint
ASP.NET 2.0 classes give more reliable solution for data caching in web
applications. C1WebData classes can still be used for projects that need
to migrate from .NET 1.0/1.1.

Regards,

-Andrey
Not Ranked
Posts 4
Sorry about that.

2.0.20063.173

We're on .net 2.0, visual studio 2005.

We are using C1WebData because that appears to be the c1 way. There isn't much in way of guidance that you guys offer... How do you recommend using c1 with the built in asp.net 2.0 controls?
Top 10 Contributor
Posts 1,645
Thanks.

> We are using C1WebData because that appears to be the c1 way.
> There isn't much in way of guidance that you guys offer... How do
> you recommend using c1 with the built in asp.net 2.0 controls?

I would recommend you to use standard ASP.NET data source controls,
such as SqlDataSource, instead of C1WebData classes. C1WebData
project is currently in maintenance state.

Regards,

-Andrey
Not Ranked
Posts 4
Ahh, right. But we have an entire winforms app written with C1. It's been in active development for about 18 months. We are now building a web app that leverages all of the business rules in the data library. We made the decision to reuse as much of the business logic as possible. That means using c1 on the web.
Not Ranked
Posts 4
cswanberg replied on Wed, Mar 14 2007 12:04 PM
Have you tried this out yet?
Top 10 Contributor
Posts 1,645
No. I'm sorry... I have currently no time for C1WebData.
I will probably have some time for this issue in the middle
of the next week.
 
-Andrey
<cswanberg> wrote in message news:192479@test.componentone.com...
Have you tried this out yet?

http://home.componentone.com/cs/forums/192238/ShowPost.aspx#192479

Page 1 of 1 (7 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.