> -----Original Message-----
> From: David Jencks [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 14, 2001 4:58 PM
> To: Dain Sundstrom
> Cc: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] MBean init/start change broke CMR
>
>
> On 2001.11.14 17:11:52 -0500 Dain Sundstrom wrote:
> > Hi all,
> >
> > I think that the merging of init and start has broken the
> CMR code. The
> > CMR
> > code depends on having a complete two-phase startup. In the phase 1
> > (init)
> > all of the relation ships are connected, and in phase 2
> (start) these
> > relationships are used to create the entity tables with
> fks, relation
> > tables, and parse ejb-ql queries. I think that merging the two has
> > changed
> > the system to call init and then start for each bean
> instead of init for
> > each bean and then start for each bean.
>
> This is correct.
Yep, I added some code to verify the order. I am getting:
ejb1.init();
ejb1.start();
ejb2.init();
ejb2.start();
ejb3.init();
ejb3.start();
ejb4.init();
ejb4.start();
> >
> > I wasn't following the discussion about this, because I
> didn't think it
> > applied to the CMR code (and the messages were very long).
>
> The first one wasn't, asking if it would break anything.
I know, but I thought the ejb-jar was one unit. So the order wouldn't
change.
> I'm going to
> > go
> > back and read the messages, but if anyone has a suggestion
> or can tell me
> > the resolution, I would appreciate it.
>
> How can I tell if it is broken? Is there a test case?
I know. There are test cases. I just haven't added them to the source tree.
> What are the "beans"
> you mention, mbeans from a *service.xml or ejbs or generated
> mbeans from
> ContainerFactory or what? What is calling the init and start? I might
> simply have done something stupid in ContainerFactory.
I am talking about ejbs. And the container init() and start methods, which
are passed through to my JDBCStoreManager class.
> If the problem is due to unexpressed dependencies between
> mbeans, generally
> the solution is to explicitly state those dependencies using
> mbean-ref and
> mbean-ref-list elements.
It is an expressed dependency between entities, but it is expressed in the
ejb-jar.xml file.
> For instance, if you have mbeans A and B that registered with
> C on init,
> and C did something with A and B in its start, put a
> mbean-ref-list element
> in C containing A and B's object names: in C's start, first
> iterate through
> the list, calling the new registerWithC(C) method (formerly
> init()), and
> then the previous start code.
I don't have that level of control all the way down at the StoreManager.
> I'm happy to help with fixing this if you can give me some
> clues about what
> is going on and where.
>
> Thanks
> david jencks
I still putting all the pieces together my self.
The way my code works is in the init each entity creates a set of objects
that represent the cmp-fields, cmr-fields, and queries for that entity. As
each cmr-field is created it checks to see if the related entity's cmr-field
has been created. If it has not been created, it does nothing. If it has
then it creates a reference to the related cmr-field object, and gives a
reference to the related entity. Only at the end of the init phase is it
guaranteed that all relationships are full setup.
In the start phase, tables are created for each entity, that may contain fks
for the related entity, or an additional table is created for the
relationship. In this phase the ejb-ql is cross compiled to SQL, and this
process requires that any referenced relationships be fully connected.
Hope that helps.
-dain
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development