If you move
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.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Regis Dubois
Sent: 05 July 2011 07:59 PM
To: Castle Project Users
Subject: Re: No Persister found for type xxx
Just to try and clarify.
compiling does not seem to be the issue.
saving the object works fine, however trying to perform a find on
another AC type before saving (1 line of code...), causes the Save()
to throw an exception.
On Jul 5, 5:45 pm, Nick Kilian <[email protected]> wrote:
> Oh right, it's you again, so another problem then? ;-D
>
> On Jul 5, 6:31 pm, Nick Kilian <[email protected]> wrote:
>
> > Reg,
>
> > haven't checked your code yet to see how you're compiling the code,
> > but could this help you?
>
> >http://groups.google.com/group/castle-project-users/browse_thread/thr...
>
> > On Jul 5, 6:13 pm, Regis Dubois <[email protected]> wrote:
>
> > > Hi,
>
> > > 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
>
> > > ActiveRecordDebug.zip
> > > 2550KViewDownload
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.