Navigation trail:Torque


Q: What is Village?

A: See the Village homepage for that infomation.


Q: Torque uses Village 2.0. I can't find any reference to that version on the Village page.

A: Village 2.0 has not been released. You can get the source by getting the latest CVS version. Instructions for doing this are on the Village homepage. When you build the project, you will have a village-2.0-dev jar file.


Q: After installing the torque plugin, xdoc generation doesn't work

A: This is a known problem. To workaround this problem, remove the maven-torque-plugin-3.1-dev.jar and the maven-torque-plugin-3.1-dev directory from you ${maven.home}/plugins directory.


Q: How can I configure Torque to use a JNDI connection

A: Read the Torque Howto for indepth information. However, here is the short howto!

{{{ torque.database.default.adapter=mssql

{{{ <resource-ref>

{{{ <Resource name="jdbc/fortius" scope="Shareable" type="javax.sql.DataSource"/>

If all else fails, first try and verify that you are able to directly create the datasource. I wrote a little action called DB.java that I could call from torque with a single action:

{{{ public void doPerform(RunData data, Context context)

-- EricPugh


Q: How can I execute a stored procedure

A: You can use some of the functionality exposed by the Village library to execute and deal with the result set of your stored procedure:

{{{ import com.workingdogs.village.Record;

What else you may notice is that if you do something similar with a complex sql query:   String SQL = "select top 50 distinct kinase_id,atp_conc from reaction where workorder_id = " + workorder.getWorkorderId() + "  and reaction.result is null and reaction.daughterboard_id is null"); 

-- EricPugh


Q: How to add P6Spy for printing SQL

A: 1) add the p6spy.jar to your application classpath {{{ 2) copy the "spy.properties" into your classpath (e.g. same location as log4j.properties)

-- Siegfried Goeschl


Q: doDelete() is throwing a TorqueException. What's up?

A: doDelete() throws a TorqueException with message "You must specify KeyDef attributes for this TableDataSet in order to delete a Record" when the schema for the table does not contain a primary key. If the table has no primary key, doDelete() may not be used to delete from it. What should be used in that case?

-- Gary Shea

TorqueProjectPages/FAQ (last edited 2009-09-20 23:04:16 by localhost)