hi,
if we use Oracle triggers there will be a problem for retrieving
timestamp using cmp since persistence field timestamp not at all there.
so we have to connect to jdbc from session bean to retrieve current
time stamp.
I guess this will be the disadvantage if we use triggers
Thanx
Purushotham
> -----Original Message-----
> From: May Charles N [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, July 25, 2000 7:57 AM
> To: [EMAIL PROTECTED]
> Subject: FW: CMP - problem
>
> Although you can use the java call
> new java.sql.Timestamp(System.currentTimeMillis())
> to generate the appropriate timestamp, we've found it better to use Oracle
> triggers on each table (before insert or update, for each row, referencing
> new...) to set this field. That way you don't have to worry about synching
> the clocks of multiple app servers if you intend to use the timestamp for
> optimistic locking.
>
> IBM suggested this approach and gives sample DB2 triggers which you can
> modify for Oracle on page 182 of their redbook SG24-5754-00.
>
> Charles May, Software Engineer
> AFCO Credit Corp. - Pittsburgh Systems Group
> A Mellon Financial Company
>
> > -----Original Message-----
> > From: Purushotham Das K [SMTP:[EMAIL PROTECTED]]
> > Sent: Saturday, July 22, 2000 7:32 AM
> > Subject: CMP - problem
> >
> > hi all,
> >
> >
> > i am having some problem while inserting records to the Oracle database
> > using cmp bean. I wanna to insert current timestamp for one of the
> columns
> > which is declared as date(in oracle).
> > How CMP field should be declared & How to generate time stamp to achieve
> > above task.
> > if i declare cmp field as date how to generate current timestamp. if
> wanna
> > pass sysdate(oracle......current date) how should i pass this using
> cmp..
> >
> >
> > Thanx
> > Purushotham
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".