db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Göschl,Siegfried" <Siegfried.Goes...@drei.com>
Subject RE: Oracle, Torque and PreparedStatements - Potential Patch of Peer.vm
Date Fri, 05 Dec 2003 18:02:47 GMT
Hi Ramesh,

ad 1. doSelect()

I don't think that a global manual replace on generated code is a convenient thing to do.
Having said that the mail includes "Potential Patch" since I'm clueless on TORQUE and ORACLE
... :-)

The doSelect() is called 4 times in the generated BaseXXXPeer - I think a refactoring of the
code would result into one single function wich in turn decides to use  a prepared statement
or not - the same is true for doUpdate(), doInsert() and doDelete(). Therefore I'm also looking
for some enlightment from the community ... anyone out there?!

ad 2.) doUpdate()

I had a quick look at the source code but I can't find the offending peace of code. Any idea
where it happens?! I definitely need a testcase for that.

Cheers,

Siegfried Goeschl

-----Original Message-----
From: Ramesh Sabeti [mailto:rs@reazon.com]
Sent: Friday, December 05, 2003 6:01 PM
To: 'Apache Torque Users List'
Subject: RE: Oracle, Torque and PreparedStatements - Potential Patch of
Peer.vm


Siegfried,

Out of curiosity, how do you use your patch? 
 
There are two separate issues that need a solution.

1.  doSelect():  This is what you tried to solve in your patch.  An
easier solution is to replace all calls to doSelect with doPSSelect in
Base*Peer.java :)  A patch is not really needed for this case :(

2.  doUpdate():  this method issues a non-parameterized SELECT first,
and that one is buried deep in the API.  I'm still looking for a
solution for that.  Want to give that a try?

Cheers to all the patch-makers,

Ramesh.

> -----Original Message-----
> From: Göschl,Siegfried [mailto:Siegfried.Goeschl@drei.com]
> Sent: Friday, December 05, 2003 8:17 AM
> To: torque-user@db.apache.org
> Subject: Oracle, Torque and PreparedStatements - Potential Patch of
> Peer.vm
> 
> Hi folks,
> 
> we recently had a discussion about Torque and problems with Oracle -
it
> seems to have problems with ad-hoc SQL statements filling up an
internal
> buffer. There is BasePeer.doPSSelect() which returns a List of Village
> Records.
> 
> The following patch could return "proper" TORQUE objects. Have a look
at
> it since it is a quick hack and I already had a cup of mulled wine ...
;-)
> ... and will have a second one before I do more patches ... :-O
> 
> Cheers,
> 
> Siegfried Goeschl
> 
> ===============================================================
> 
> PEER.VM
> 
>   ## ------------------------------------------------------------
>   ## Patch by Siegfried Goeschl
>   ## ------------------------------------------------------------
> 
>     /**
>      * Do a Prepared Statement select according to the given criteria
>      *
>      * @param criteria
>      * @return Result as Torque generated objects and NOT Village
Records
>      * @throws TorqueException Any exceptions caught during processing
> will be
>      *         rethrown wrapped into a TorqueException.
>      */
>     public static List doPSSelectEx(Criteria criteria) throws
> TorqueException
>     {
>      	List v = null;
>      	List temp = null;
> 
>     	// add the columns to the criteria
>     	$basePrefix${table.JavaName}Peer.addSelectColumns( criteria );
>     	// invoke the BasePeer to get the list of Village Records
>     	temp = $basePrefix${table.JavaName}Peer.doPSSelect( criteria );
>     	// convert the VillageRecords into Torque objects
> 	v = $basePrefix${table.JavaName}Peer.populateObjects( temp );
> 	return v;
>     }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org



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


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


Mime
View raw message