You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Tobias Hilka <th...@vps.de> on 2007/07/05 18:26:16 UTC

Missing connection parameter

Hello,

 

I was checking our application to see if within a single transaction all
calls to torque use the methods with the additional Connection parameter.
Doing this I found some problems within Torque:

 

- The method copy(boolean) does not take a connection as parameter. This
might lead to a deadlock if you use deepcopy and you have foreign keys to
other tables. The methods get...() are called, not the methods
get...(Connection).

- 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"
methods (the one without connection). To do clean programming, we need the
methods to take an additional connection parameter.

 

 

Thanks,

 

Tobias

 


Re: AW: Missing connection parameter

Posted by Thomas Vandahl <th...@tewisoft.de>.
Tobias Hilka wrote:
> Hi Thomas,
> 
> I just patched the template Object.vm to provide the missing connection parameter. 
> 
> What is the appropriate way to provide this patch?

Go to https://issues.apache.org/jira/browse/TORQUE and open a new issue 
and attach the patch. Please keep in mind that there is another template 
ObjectWithManager.vm, that would need patching, too.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


AW: Missing connection parameter

Posted by Thomas Fischer <fi...@seitenbau.net>.
Please open up a issue in scarab and attach the patch.

   Thanks in advance,

         Thomas

"Tobias Hilka" <th...@vps.de> schrieb am 24.07.2007 14:01:03:

> Hi Thomas,
>
> I just patched the template Object.vm to provide the missing connection
parameter.
>
> What is the appropriate way to provide this patch?
>
> Tobias
>
> -----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.
>
>         Thomas
>
> "Tobias Hilka" <th...@vps.de> schrieb am 05.07.2007 18:26:16:
>
> > Hello,
> >
> > I was checking our application to see if within a single transaction
all
> calls
> > to torque use the methods with the additional Connection parameter.
Doing
> this
> > I found some problems within Torque:
> >
> > - The method copy(boolean) does not take a connection as parameter.
This
> might
> > lead to a deadlock if you use deepcopy and you have foreign keys to
other
>
> > tables. The methods get...() are called, not the methods
> get...(Connection).
> > - 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”
> methods
> > (the one without connection). To do clean programming, we need the
> methods to
> > take an additional connection parameter.
> >
> >
> > Thanks,
> >
> > Tobias
> >

AW: Missing connection parameter

Posted by Tobias Hilka <th...@vps.de>.
Hi Thomas,

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

What is the appropriate way to provide this patch?

Tobias

-----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.

        Thomas

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

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

> tables. The methods get...() are called, not the methods
get...(Connection).
> - 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”
methods
> (the one without connection). To do clean programming, we need the
methods to
> take an additional connection parameter.
>
>
> Thanks,
>
> Tobias
>

RE: Missing connection parameter

Posted by Thomas Fischer <fi...@seitenbau.net>.
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.

        Thomas

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

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

> tables. The methods get...() are called, not the methods
get...(Connection).
> - 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”
methods
> (the one without connection). To do clean programming, we need the
methods to
> take an additional connection parameter.
>
>
> Thanks,
>
> Tobias
>