Re: get the SQL to be executed
You can use a logging driver such as p6spy to see your SQL statements. http://sourceforge.net/projects/p6spy/ On 19 January 2012 08:25, Thomas Fox thomas@seitenbau.net wrote: Perhaps you can use the log output (with some tweaks to the log4j configuration). However I'm not sure how and if Torque 3.3 logs the update statements. But then again I've heard of drivers which at as a bridge between the application and the real driver (e.g http://www.squirrelsql.org/) and which can do the logging for you. Torque 4 will not work because it uses prepared statements for updates, this will not give you any sensible sql. Thomas Hello all, is there a way in Torque to get the SQL that is sent to the DB. I have to generate a txt file where I save queries basically INSERT statements of long records. I was thinking of create the Torque classes, populate the objects with data that I get from a local instance of the DB and then, instead of using a save command, get the SQL that would be executed and store it in a file. Alternatively I could use this: http://openhms.sourceforge.net/sqlbuilder/ but has dependencies that requires GPL license and I would avoid in this case that kind of license. - To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org For additional commands, e-mail: torque-user-h...@db.apache.org - To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org For additional commands, e-mail: torque-user-h...@db.apache.org
Re: Excessive database queries on postgresql: village metadata queries
On 7 July 2010 21:32, Graham Leggett minf...@sharp.fm wrote: On 07 Jul 2010, at 4:43 PM, Greg Monroe wrote: Torque has been using Village pretty much since day 1.. and AFAIK the Village has been using metadata as long. If you didn't have performance problems before, it's probably a JDBC version problem. I had a similar issue with Sybase https://issues.apache.org/jira/browse/TORQUE-36 We worked around by creating manual prepared statements on the critical queries which was a whole bunch of trouble. https://issues.apache.org/jira/browse/TORQUE-36Joe
Re: java.lang.OutOfMemoryError
For the latest versions of 1.4.2 (_10 and up) and 5/6 there is a very useful utility called jmap - http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jmap.html that's built into the Java SDK. This dumps out all the objects in the heap. Doesn't work under windows though.. Joe On 30/12/06, Thomas Fischer [EMAIL PROTECTED] wrote: An out of memory error is typically very difficult to pinpoint. The place where this error occurs is typically not connected to the place where the problem sits. Personally, I know of two ways of dealing with this - you can have an idea what happens. The answers before have provided situations where OutOfMemory-Problems typically happen. - If you think that none of the typical causes apply to you, you have to find out the hard way. To get an idea of the cause of the problem, create a heap dump of the virtual machine just after an OutOfMemory-Error occured (on linux, this is done by using the kill -3 command on the appropriate process). Then, scan through the heap dump to see which objects occur most often. These are usually the objects which are not dereferenced and cause the memory overflow. Then go through the code and find out where these objects are created, and why they are not thrown away after being used. You might need more information out of the heap dump than just the class names of the relevant object; there are tools showing the refences out of heap dumps but I never used one myself. Hope this helps, Thomas On Mon, 18 Dec 2006, jill han wrote: What could cause java.lang.OutOfMemoryError ? The application is built on turbine/torque/velocity. Thanks in advance Jill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Torque plugin for Eclipse
I can confirm that the ant scripts work fine in Eclipse. Don't forget the build.properties though - which eclipse does confuse with plugins but just click the plain text edit or use a different name in the ant build file. Remember to press F5 (refresh) after a generate too! :-) We use WTP 1.5 and it has good XML validation/editting. Joe On 17/10/06, Greg Monroe [EMAIL PROTECTED] wrote: There is not a specific Torque plug-in but since it's Maven and Ant driven, it works fine in this environment. There is a Maven plug-in for Eclipse that can run the generator, see www.mevenide.codehaus.org. FYI, Torque still works best with Maven 1.x, 2.x support is still rudimentary. FWIW, I use ant build files for my projects and these work well in Eclipse. For editing Schema files, there is a lot of Eclipse XML options out there. I use Eclipse with the MyEclipse addin and this does a decent job of handling XML validation, etc. One thing to remember is that Torque is not like a lot of other OM layers. It requires very little bookwork (unlike that H.. word one 8) ) and hence IMHO no specific plugin is needed. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 8:05 AM To: Apache Torque Users List Subject: Torque plugin for Eclipse Hi. Is there any plugin available for Torque in eclipse If yes, then kindly forward me the download URL. Thanks. regards, Anand \ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring encoding that is used for jdbc connection
Certainly for Sybase it's set via the database itself. It's independent of Torque. We moved to UTF-8 to avoid charset issues. Joe On 06/09/06, Thomas Fischer [EMAIL PROTECTED] wrote: Hi, I do not know of a feature of Torque that allows setting the encoding of characters sent to the database. I would expect one would have to set that inside the database driver. Did you check the Mysql Driver documentation ? Thomas Anton Tonchev [EMAIL PROTECTED] schrieb am 06.09.2006 09:52:51: Hello! I am trying to configure torque so that it manages cyrillic characters correctly. The database (in my case MySQL) is configured to use as default charset cp1251. Anyway when i try to save something in cyrillic through torque i get in the database. Where i can specify the encoding of the connection to the database? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Torque using Tomcat
We explicitly laod the properties file and pass the Configuration into Torque.init by using PropertiesConfiguration files. See Apache commons Configuration. I sure there's more details of how to load and debug the file loading there. It's most likely looking in your current directory. Joe On 23/06/06, Norbert Kunstek [EMAIL PROTECTED] wrote: Thank you! But that's not the problem. It can't find the Torque.properties!!! -Ursprüngliche Nachricht- Von: Apache Torque Users List torque-user@db.apache.org Gesendet: 22.06.06 15:49:37 An: Apache Torque Users List torque-user@db.apache.org Betreff: Re: Torque using Tomcat Hi, I think the problem can be with your: import org.apache.torque.Bank where Bank is a generated class by Torque, so I doubt it has been generated in the org.apache.torque package. Norbert Kunstek wrote: Hello, I've tried to use Torque within the Servlet but I receive always a ClassNotFound-Exception. Maybe somebody could solve the Problem: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.torque.Bank; import org.apache.torque.Torque; import org.apache.torque.TorqueException; //import org.apache.torque.Torque; //import persistence.Bank; public class HelloServlet extends HttpServlet { public void init() throws ServletException, UnavailableException { try { ServletContext ct = getServletContext(); PropertiesConfiguration config = new PropertiesConfiguration(); config.load(ct.getResourceAsStream(/WEB-INF/Torque.properties)); Torque.init(config); } catch (ConfigurationException e) { System.out.println(Configuration: Initialisierung fehlgeschlagen + e); } catch (TorqueException e) { System.out.println(Init: Initialisierung fehlgeschlagen + e); } } public void doGet( HttpServletRequest requ, HttpServletResponse resp ) throws ServletException, IOException { try { Bank sparkasse = new Bank(); sparkasse.setBankId(111); sparkasse.setName(Apache); sparkasse.setCity(Torque); // CREATE sparkasse.save(); } catch (Exception e) { System.out.println(initializing of Torque failed + e); } resp.setContentType( text/html ); PrintWriter out = resp.getWriter(); out.println( ); out.println( Servus, ); out.println( Torque! ); out.println( ); out.close(); } } __ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Torque using Tomcat
Shouldn't your classes be in WEB-INF/classes not WEB-INF/src? Joe On 23/06/06, Norbert Kunstek [EMAIL PROTECTED] wrote: Hello, I have all the required jar-files in the WEB-INF/lib directory (torque runtime + dbdriver). My Torque.properties is in the WEB-INF directory. I have the HelloServlet + the bank-classes in the WEB-INF/src directory.
Re: No search for mailing list archives ??
The alternative is to use a JDBC driver like p6spy. This puts itself between Torque and the real driver. Has the advantage of getting any JDBC written by hand too. Works very well - but don't use it on a production server as it leaks like a sieve! Joe On 08/06/06, Eustache [EMAIL PROTECTED] wrote: Eustache wrote: Greg Monroe wrote: Try: http://www.mail-archive.com/ -Original Message- From: Eustache [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 11:21 AM To: Apache Torque Users List Subject: No search for mailing list archives ?? At least I could not find it on http://db.apache.org/torque/ ... if there is not it's really ... a pity I wanted to search if anyone knows how to log sql requests generated by Torque ? Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thx ! Maybe adding a link on the mail archive page would be good ? However I could not find anything on how I could log those sql requests generated by Torque. Any idea ? Thx again - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] OK I found it, just have to turn DEBUG on in my log4j.properties file. Sorry for the newbie question. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Prepared statements
-Original Message- From: Thomas Vandahl [mailto:[EMAIL PROTECTED] Sent: 24 May 2006 16:50 To: Apache Torque Users List Subject: Re: Prepared statements Joseph Carter wrote: We're doing some performance testing on Torque and we've noticed that it doesn't seem to use prepared statements. Is there some configuration option for this? Or some other way of setting Torque to use prepared statements? Torque (or Village for that matter) does use prepared statements for all insert and update operations. You can use doPSSelect in any generated Peer class to use prepared statements for a select. However be aware that Village chokes on joins then. ok, thanks - I got an error on torque 3.1 when I tried this. Complaint about CHAR/NUMERIC conversion. I've just upped to 3.2 so I'll try that out. Would you please keep this rubbish off the list. Sorry about that garbage. Our work mail server adds it. I've switched to my personal account to avoid it. Apologies. Thanks. Bye, Thomas. Thanks the quick response, Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]