plzz give use of ejbPostcreate() with example..


EJB programming & troubleshooting: plzz give use of ejbPostcreate() with example..

  1. plzz give use of ejbPostcreate() with example.. (5 messages)

    dear sir/madam,

      My name is Maruthi Ram, I am a student and has some knowledge with EJB. I am unable to under stand the exat use of ejbpostcreate.

      If possible please give an example with bmp and cmp .

     And I have another request to u . can u tell me how an auction site will work and where the EJB comes in to seen.

    In waiting for ur reply...
  2. purpose of ejbPostCreate[ Go to top ]

    After creating the bean using ejbCreate if at all u want to do any database opertion before servicing the client request when the bean is existing such knowing the properties of the bean
  3. Since ejbPostCreate() is called *after* the database insert, it can be used for operations that are only valid after a database record exists. A typical use case is setting up foreign key relationships to your newly-created entity, which can't be done until after the record is created.

    The majority of the time, though, this method is unused.
  4. Your won't be getting the remote object after calling ejbcreate method.It looks for ejbPostCreate() method.This method can be used to intiialize of all the variables which u forgot to initialize in ejbcreate and u can complete u'r database operations also here itself.
  5. can u give with example...[ Go to top ]

    Dear madam,
         I under-stood what u said. In many of the books also i have found the same thing. In Orelly EJB i found that to maintain REFERRENTIAL INTEGRITY we need to do ejbPostcteate() first what actually it will do .
       In boty CMP and BMP we are not going to write any thing to it. what is the behind process.. plzzzz take an example and expllain... like assume two tables with master - chaild relationships...

      I have anoter querey WHAT IS THE DIFFERENCES BETWEEN TagSupport and BodyTagSupport. and when to use eath of them give alll possible differences

    Thank U for ur reply..

    Maruthi Ram.
  6. can u give with example...[ Go to top ]

    A BodyTag can manipulate its body, using its BodyContent object, while a normal Tag cannot. BodyTags are useful when you want to use or transform the contents of the tag.

    For example, suppose you want to have a <cust:param> tag that sets parameter values using the tag body:

    <cus:param name="[param-name]">[param-value]</cust:param>

    This would have to be implemented as a BodyTag, which could get the tag contents (and the parameter value) as follows:

    public int doAfterBody() {
        String paramValue = bodyContent.getString();
        // More logic ...