Hi Richard,
I'm trying to use the framework with ASP.NET and IIS,
and I'm using the AF_OLEDB provider for Access.
When I postback via a page button event I can
successfully retrieve and load an object and its
associations via myOject.Find(myObject, False).
However, after I've edited the object in the page, do a
postback, and execute myObject.Save(True), the output
window displays "ROLLBACK TRANSACTION" and no
updates to the database occur. From debugging, it
seems the exception is being thrown in the
PersistenceBroker's SavePrivateObject method which
perculates up to the SaveObject method where the
exception is caught.
I'm guessing there's a problem with managing the
PersistenceBroker and/or database connection between
postbacks, and that I'm not properly handling state in
the whole process.
Do you have some general guidelines or a code
example illustrating a best practice approach to using
the framework with ASP.NET? (Admittedly, I'm new to
ASP.NET and web development in general, so this is
partially a newbie problem.)
Thanks,
Wyatt
Logged In: YES
user_id=1217277
Hi Richard,
Any ideas or comments?
Thx,
Wyatt
Logged In: YES
user_id=253192
Sorry for the lack of response - I didn't notice the new support
item (my fault).
I would think that if you are getting a failure in
SavePrivateObject that there a problem in one of the
update/insert statements being executed. The exception
should have a message indicating what the problem was and
you should be able to see this when debugging.
Have a look at the generated SQL and see if you can identify
the SQL statement produced just before the rollbacks
commence. Try manually running this statement as a query
in Access and see if you can identify the problem. It could
be a reserved word is being used, or there is a typo on one of
the column names, or some DB constraints are being
violated.
Because the connections to the database are shared and
there is only one persistence broker, you shouldn't have a
problem with state management between page loads. I
wouls usually recommend that the broker be initialised either
during application start or session start. Doing it on a page
by page basis could be slow.
Logged In: YES
user_id=1217277
Hi Richard,
Thanks for the advice. I'll give it a try, though it may be a
week or two before I can get back to it... lots of other things
on the plate now.
Wyatt