cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject RE: [RT] Direct Form-&gt;SQL mapping through OJB and DynaBeans
Date Fri, 31 Oct 2003 21:58:06 GMT
Hunsberger, Peter dijo:
> Sylvain Wallez <sylvain@apache.org> writes:
>>
>> Hunsberger, Peter wrote:
>>
>> >>I have been thinking about the direct sql mapping on and off, the
>> biggest problem I was able to identify (not solve) is that
>> sql is not
>> >>'symmetric' in its load and save operations (while woody binding is)
>> >>
>> >>with symmetric I mean for doing updates or inserts you
>> can't just give
>> >>a resultset back to the JDBC connection...
>> >>
>> >>
>> >>
>> >
>> >Well, you can if your JDBC drivers support it.  In
>> particular, look at
>> >sql.ResultSet.CONCUR_UPDATABLE (and the updateXYZ methods)
>> which lets you make a record set updatable so that you can
>> edit directly and the send it back to the database.  This
>> requires JDBC 1.2. However, I know you really don't want to
>> keep a resultSet open across a Web transaction and I believe
>> this feature requires that the retrieve/update all occur
>> within the same SQL transaction so I believe that rules it out....
>> >
>> >
>>
>> Exactly. Keeping an open SQL connection during a web interaction is
>> waaaay dangerous.
>
> Well, I'd say more like just plain dumb ;-)  However, it occurs to me
> that you could fake this one level down from the forms handler (making
> it appear symmetrical to the forms handler):
>
> 1) Retrieve the resultSet, close the connection, but save the result set
> (continuation?)
> 2) When the Web client comes back retrieve a new result set.  Walk the
> two result sets
>    and compare and reconcile any differences, updating the newly
> retrieved result set as appropriate.
> 3) Send the new result set back.
>
> In general, this moves the responsibility for locking up a level which
> isn't something I'd care to code, but if you're going to use JDO I
> believe you'll just get a last change wins result anyways, which is how
> you could manage this...

Yep. This is exactly what I am doing right now. But I am research a more
elegant solution.

Best Regards,

Antonio Gallardo




Mime
View raw message