From: gk on
"You need to use ejbPostCreate() to define operations, like set a
flag, after INSERT completes successfully"

-----what kind of operations we are talking about ? can you please
post few examples here ?
-----what is flag setting here ?I don't understand this. Could you
please elaborate this part?
From: Arne Vajhøj on
On 06-05-2010 08:10, gk wrote:
> "You need to use ejbPostCreate() to define operations, like set a
> flag, after INSERT completes successfully"
>
> -----what kind of operations we are talking about ? can you please
> post few examples here ?

Most likely adding information other places.

> -----what is flag setting here ?I don't understand this. Could you
> please elaborate this part?

Most likely just setting a boolean somewhere.

Arne


From: gk on
On May 7, 5:16 am, Arne Vajhøj <a...(a)vajhoej.dk> wrote:
> On 06-05-2010 08:10, gk wrote:
>
> > "You need to use ejbPostCreate() to define operations, like set a
> > flag, after INSERT completes successfully"
>
> > -----what kind of operations we are talking about ? can you please
> > post few examples here ?
>
> Most likely adding information other places.

adding information ? where ? Could you please elaborate this ? Not
getting you.

>
> > -----what is flag setting here ?I don't understand this. Could you
> > please elaborate this part?
>
> Most likely just setting a boolean somewhere.

setting a boolean ? Could you please elaborate this ? Not getting you.

> Arne

From: Arved Sandstrom on
gk wrote:
> "You need to use ejbPostCreate() to define operations, like set a
> flag, after INSERT completes successfully"
>
> -----what kind of operations we are talking about ? can you please
> post few examples here ?
> -----what is flag setting here ?I don't understand this. Could you
> please elaborate this part?

One example of where you might use ejbPostCreate() is in setting cmr
(container-managed relationship) fields; in other words, setting
foreign-key fields.

I stand to be corrected - it's been a few years since I used EJB 2.x -
but I would think that if you do not have container-managed
relationships in CMP, that you don't need anything in ejbPostCreate() at
all.

And that quote - wherever you got it from - is terrible. It led you
astray, and I can see why. Set some flags? What flags? How about just
providing an example of one of the most common use cases for
ejbPostCreate()? Whatever article or book you got that quote from, just
throw it away.

AHS
From: Arne Vajhøj on
On 07-05-2010 03:23, gk wrote:
> On May 7, 5:16 am, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>> On 06-05-2010 08:10, gk wrote:
>>> "You need to use ejbPostCreate() to define operations, like set a
>>> flag, after INSERT completes successfully"
>>
>>> -----what kind of operations we are talking about ? can you please
>>> post few examples here ?
>>
>> Most likely adding information other places.
>
> adding information ?

Yes. Adding information. In the plain English meaning of the
words.

> where ?

Wherever you want.

> Could you please elaborate this ? Not
> getting you.

The difference between ejbCreate and ejbPostCreate is that for
database generated primary keys the primary key is not available
in ejbCreate but it is available in ejbPostCreate, so if you
need to run some code when creating an object (inserting a row)
where you need to know the primary key which is generated by
the database, then you need to put that code in ejbPostCreate.

It is not something that is used much. I don't think that I
have ever used that feature.

>>> -----what is flag setting here ?I don't understand this. Could you
>>> please elaborate this part?
>>
>> Most likely just setting a boolean somewhere.
>
> setting a boolean ? Could you please elaborate this ? Not getting you.

Setting a boolean. As in if not plain English then plain IT English.

Arne