I don't know about any libraries but I did make my own components who do
what you ask for (I think). The problem is that this code isn't ready to be
used by other persons at all. It's not very stable yet and there might be
some problems. But for my stuff it works OK.
Here's more or less what I do:

- define all my queries in separate conf files (nicer would be in xml of
course ;-)
these file contain the query, which connection (db) to use, whether it's
updateable, retrieval arguments, column settings (like default values,
validation, formatting, ...), caching params
- in the JSP page, you declare a bean and give set the name property.
- an other component reads the settings for that name.
- the query is executed and values are stored in a structure in memory (and
can be cached.)
- by using getValue() you can have string representations of the columns.
- when you submit a form, the parameters are send to the same transaction
object.
- depending on what you defined, I create a statement to
        - insert the values as a new row,
        - update the changed columns or all columns.
        - check whether update or insert should be used.
- the appropriate SQL is executed (insert or update)

I use this now for a while, but it's still changing a lot.
If you're interested in the details, I could show you some code but I don't
garantee that it'll work OK in your case.

Geert 'Darling' Van Damme





> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Radhakrishnan, Sanjay (c)
> Sent: vrijdag 21 januari 2000 16:39
> To: [EMAIL PROTECTED]
> Subject: OFFTOPIC: Data Concurrency & Consistency
>
>
> Im wondering if there are any tools/libraries/frameworks which allows
> applications written in Java to easily maintain data
> concurrency/consistency
> .
>
> Let me give a case where i would need this tooll/library.
>
> User 1 selects records 1,2 & 3 from table A
> User 2 selects records 1,3 & 4 from table A
>
> User 2 updates record 1 with a different set of values.
>
> Now User 1 tries to update record 1 with his set of values. But user 1s
> update would fail because he won't be able to find the record he
> retrieved(i.e. record 1) as it would have been already changed by user 2.
>
> To avoid this the app would have include the original values that user 1
> retrieved from the database initially. If the app does this then
> there wont
> be a match in the database for this update statement and the app
> can flash a
> message to user 1 saying the record has already been updated/deleted by
> another user.
>
> Do any of you know of a tool/library/bean which can give the same type of
> functionality. Ideal case would be i would just have to declare
> to the bean
> to use Key and Modifiable columns or Just Key columns or Key and
> updateable
> columns in the where clause and it would generate the update/insert/delete
> statement accordingly.
>
> Appreciate your inputs
> Sanjay
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to