tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Ayers" <danny...@virgilio.it>
Subject RE: saving object
Date Fri, 05 Apr 2002 22:48:18 GMT
I guess a lot will depend on the capabilities of the DB - not all support
stored procedures. Doing the operations as (atomic) transactions might also
be an answer, DB permitting. Alternately you could perhaps have a static
server-side class that keeps track of ids, or maybe even pump a 'dirty' flag
back somewhere until client & server are sync'ed.

Cheers,
Danny.

---
Danny Ayers
<stuff> http://www.isacat.net </stuff>


>-----Original Message-----
>From: Henry [mailto:hxzhang@binary-solutions.net]
>Sent: 06 April 2002 00:15
>To: Tomcat Users List
>Subject: Re: saving object
>
>
>Would you give me an example?  I am not familiar with stored procesure
>though...
>
>thanx a lot!
>
>
>----- Original Message -----
>From: "Jim Urban" <jim.urban@netsteps.net>
>To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>Sent: Friday, April 05, 2002 3:06 PM
>Subject: RE: saving object
>
>
>> Can you use a stored procedure to inset the row?  The stored
>procedure can
>> query the id of the row just inserted and pass it back to you as
>an output
>> parameter.
>>
>> Jim
>>
>> > -----Original Message-----
>> > From: Henry [mailto:hxzhang@binary-solutions.net]
>> > Sent: Friday, April 05, 2002 3:42 PM
>> > To: Tomcat Users List
>> > Subject: saving object
>> >
>> >
>> > a little bit off topic.
>> >
>> > I have a table with each row corresponds to a javabean object. The
>objects
>> > don't
>> > necessarily have a primary key, so i use a sequence number as its
>primary
>> > key, and a
>> > trigger to assign the sequence number to its ID column when a new
>> > object is
>> > inserted
>> > into the database.
>> >
>> > However, after I insert the object into the table, how can i know the
>> > object's ID in the
>> > table?  If I simply do a "..._seq.cur_val",   it is not safe when
>multiple
>> > users can access
>> > the database and save their javabean into it at the same time.
>> >
>> > How could you guys accomplish that?
>> >
>> >
>> > --
>> > To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> > For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>> > Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>> >
>> >
>>
>>
>> --
>> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>
>
>--
>To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message