El Martes, 08 de Octubre de 2002 01:09, Christian Haul escribió: > On 07.Oct.2002 -- 11:32 PM, Antonio Gallardo Rivera wrote: > > Thanks for the help! > > > > I found that in dbAddAction, we must to supply into the descriptor like > > "key" all the values that cannot be null! This is not describen into the > > documentation. > > I'm not sure I understand right, but the <key/> tags need to list all > the columns that make up the primary key (or any candidate > key). Obviously, columns contained in the primary key may not be null. >
First, thanks for your attention. :) Second, please sorry for my english. I know its very poor. :( I agree with you. I have foreign keys that are not part of the primary key and also they does not can be null. The only way I found to make it work is include this foreign keys in the descriptor as part of the primary key. My table is: can_id (Primary key) usr_id (Foreign Key) cli_id (Foreign Key) All this parameters are set based on the request-params the page get. For example: <parameter name="cli_id"> <xsp:attribute name="value"> <xsp-request:get-parameter name="cli_id"/> </xsp:attribute> </parameter> The problem is into the dbAddAction, because if I put the cli_id into the descriptor as part of the <values> of the table the action raise me an error that said that cli_id cannot be null. For example: <validate dbcol="cli_id" param="cli_id" type="long"/> Into the descriptor the parameters is defined as: <parameter name="cli_id" nullable="no" type="long"/> and the FormValidatorAction tell that the form result is OK. Then comes the dbAdd and raise the error. > > I as not able to check my problem, because the FormValidatorAction tell > > that all the valuse was there. But as I can see, it looks like the > > dbAddAction make two database operations, first insert the fileds with > > "key" tags and after make an update of the register. I think this is not > > admisible. Because you can have some not-null values that you cannot > > insert in the first insert with only the key. > > No, this is not correct. The DatabaseActions insert a row in one go > and all operations in one transaction. > > I assume you are running a recent CVS snapshot? Yes. I am using the lastest CVS. > > If so, please note that the name of some modules have been changed and > that the compiled in default is rendered useless. There should be a > warning in your logs indicating this. Please add a > <output>request-attr</output> and <input>request-param</input> at the > action declaration to restore the old behaviour. Please explain me more about that. I saw a similar approach in some Java generator to improve performance of the parameters. Is this similar approach that are you doing here? I will be glad of that :). > > Chris. --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>