The insert procedure by-passes OJB's normal insert. Your procedure must
handle the actual insert as well. 

> -----Original Message-----
> From: Ismail Siddiqui [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 09, 2005 9:49 AM
> To: OJB Users List
> Subject: insert-procedure
> 
> Hi All,
> I am trying to execute a stored procedure after a class get 
> inserted in database..
> 
> this is the code snippet from my action class
> 
>         VoteForm vForm = (VoteForm)form;
>         Vote v = new Vote();
>         voteLogic.createVote(vForm);
>         return mapping.findForward( "success" );
> 
>  where createVote simply store in databse.
> 
> 
> 
> i am using following descriptor:
> <class-descriptor
>         class="com.alloyinc.rater.bean.Vote"
>         table="RATER_VOTE">
>     <field-descriptor
>             name="id"
>             column="vote_id"
>             jdbc-type="INTEGER"
>             primarykey="true"
>             autoincrement="true"
>             access="readonly"/>
>     <field-descriptor
>             name="itemId"
>             column="item_id"
>             jdbc-type="INTEGER"
>             access="readwrite"/>
>     <!--
> 
>       <field-descriptor
>             name="personId"
>             column="person_id"
>             jdbc-type="INTEGER"
>             access="readwrite"/>
>     <field-descriptor
>             name="weight"
>             column="weight"
>             jdbc-type="FLOAT"
>             access="readwrite"/>
> 
> 
>      <insert-procedure name="update_avg_weight">
>         <runtime-argument field-ref="itemId" />
>      </insert-procedure>
> 
> 
> 
> </class-descriptor>
> 
> 
> 
> when i include insert-procedure line , surely its getting 
> executed but no record in RATER_VOTE table is getting added . 
> when i remove insert-procedure line .. the records get added 
> but of course no stored procedure get executed.
> 
> Any Idea??
> 
> 
> 
> thanks
> 
> Ismail Siddiqui
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to