db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Hilka" <thi...@vps.de>
Subject AW: Missing connection parameter
Date Tue, 24 Jul 2007 12:01:03 GMT
Hi Thomas,

I just patched the template Object.vm to provide the missing connection parameter. 

What is the appropriate way to provide this patch?


-----Ursprüngliche Nachricht-----
Von: Thomas Fischer [mailto:fischer@seitenbau.net] 
Gesendet: Freitag, 6. Juli 2007 08:48
An: Apache Torque Developers List
Betreff: RE: Missing connection parameter

Hi Tobias,

I had similar problems a year or two ago. The solution was to use the
torque.silentDbFetch generator  parameter. The idea is that all db fetches
of foreign relations must be done explicitly with the get(connection)
methods; the get() methods only return the cached results This gives you
full control over what you fetch from db with which connection.
The downside of full control ist that you have to exercise it, i.e if you
want to make a deep copy, you have to fetch the related objects beforehand
by calling the corresponding get(connection) methods.
Nevertheless In my opinion a copy(connection) method would be useful. A
patch would be welcome.


"Tobias Hilka" <thilka@vps.de> schrieb am 05.07.2007 18:26:16:

> Hello,
> I was checking our application to see if within a single transaction all
> to torque use the methods with the additional Connection parameter. Doing
> I found some problems within Torque:
> - The method copy(boolean) does not take a connection as parameter. This
> lead to a deadlock if you use deepcopy and you have foreign keys to other

> tables. The methods get...() are called, not the methods
> - Same problem with the add… methods when you add a new object which is
> referenced by a foreign key.
> We really had some troubles in our application with the “convenience”
> (the one without connection). To do clean programming, we need the
methods to
> take an additional connection parameter.
> Thanks,
> Tobias

View raw message