I have been using ActiveRecord for quite a while, so far without much
issues.
Today however I came accross a problem which baffles me.
I have attached some code as it better describes the issue.
Basically I compile a class and register it dynamically within
ActiveRecord (using ActiveRecordStarter.RegisterAssemblies(typeAssembly))
and then create an object of this type using reflection.
Calling Save() on the object works fine and it is perfectly commited into
the DB.
HOWEVER, if I attempt to first perform a search on another ActiveRecord
Type then I get a "no persister found" exception when trying to save.
I know... that makes no sense...
I have attached some code to this email, can somebody kindly have a look
at the problem?
The code comes with 2 unit tests, one to create the type, the second one
to persist the object.
To reproduce the problem, just uncomment the line:
//TypeRelationship.FindByOwnerId(typeId);
Thanks,
Regis
TypeInformation ti = TypeInformation.FindByName("iTradeType1");
So it is after your call to
RegisterAssemblyInActiveRecord(typeAssembly);
Then it works fine. So if it's possible for you to register your dynamic
types before the first database call to AR then I would suggest taking that
route.
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to
castle-project-u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.
Not sure I can since the call is embedded within a recursive call method.
Should this not be logged as a bug?
> To post to this group, send email to castle-project-
> us...@googlegroups.com.
> To unsubscribe from this group, send email to
> castle-project-u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Castle Project Users" group.
> To post to this group, send email to castle-project-
> us...@googlegroups.com.
> To unsubscribe from this group, send email to castle-project-
> users+un...@googlegroups.com.