Title: what does this mean?
Opps, sorry, I meant related, not dependent.
 
Keith
 
-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 6:02 p.m.
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

Ok, I'll give it a try.
 
Incidentally, TemplateComponent is not a dependant, it is just related. This is required because it is a many-to-many relationship between page and template component. I couldn't use an actualy man-to-many relationship though because there is a variable on the association - hence the need for the association class TemplateComponentAssoc.
 
I am inside Tomcat 4. This is not a long transaction although I do use them for other things.
 
Thanks,
Brett
-----Original Message-----
From: Keith Chew [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 3:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

 
Hi Brett
 
Try removing the keygen for the dependent field, ie TemplateComponent in your case.
 
PS: What environment are you running castor in? app server (eg JBoss) or standalone?
 
Keith
 
-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 5:43 p.m.
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

Hi, and thanks for your help. A question:
 
remove the key-gen on which? The TemplateComponent or the TemplateComponentAssocation?
 
Structure:
 
Page (1) -----by pageId in TCA----> (n) TemplateComponentAssociation (n) ---- by componentId in TCA ---> (n) TemplateComponent
 
Each generates ID by identity.
 
If I were to remove this, I must assign an ID each time which will be a real nuisance (but at least it'll work :)
 
Cheers,
Brett
 
-----Original Message-----
From: Keith Chew [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 3:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

Hi Brett
 
Can you try removing the key-gen to see if you still have the problem? Numerous posts have indicated that this could be a potential problem.
 
Keith C
 
 
-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 5:24 p.m.
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

That is what I suspected. I can't explain why Castor isn't assigning the id correctly, everything seems ok... but I get
----- Nested exception -----
java.sql.SQLException: General error: Column 'componentId' cannot be null
        at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
        at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
        at org.gjt.mm.mysql.Connection.execSQL(Connection.java:885)
        at org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:389)
        at org.exolab.castor.jdo.engine.SQLEngine.create(SQLEngine.java:616)
I have definitely set the component to something without a null id, and mapped it:        
 
<field name="component" type="au.com.f2.shopping.page.TemplateComponent">
    <sql name="componentId" />
</field>
But I Get:
Castor: Loading au.com.f2.shopping.page.Page (11)
Castor: Loading au.com.f2.shopping.page.TemplateComponent (7)
Castor: Creating au.com.f2.shopping.page.TemplateComponentAssociation (null)
Perhaps the null here is just because I am using key-generator="IDENTITY", since it is the componentId that is the problem.
 
Can anoyone help? Please! :) I'm not seeing any problem in the source in SQLEngine either...
 
Cheers,
Brett
-----Original Message-----
From: Low Heng Sin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 28 November 2001 3:03 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] what does this mean?

That is the object identity.
-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 11:55
To: [EMAIL PROTECTED]
Subject: [castor-dev] what does this mean?

I turned on castor's logging and looked into the file and got:

Loading Category (1)
Loading Retailer (3)
etc

What is the number in the brackets?

The problem I am having gives this line:
Loading TemplateComponent (Null)

So it would help diagnose it (see the archive - "creating a related object - id is null?" - I have no answers yet).

Cheers,
Brett

~*~*~*~*~*~*~
Brett Porter - Web Developer
f2 Network ~ everything essential
Ph: +61 2 8596 4437
Email: [EMAIL PROTECTED]

Reply via email to