db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Missing connection parameter
Date Fri, 06 Jul 2007 06:48:09 GMT
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