RE: Torque is very slow to do a .copy of an object :( Why?
Thanks a lot for all of your answers. Now I understand wh I had duplicate entries in another table ;) I tried to use the function .copy(false) but apparently this one does not exists (I'm using torque 3.2-rc2) :( Alain Greg Monroe wrote: I remember there was a discussion a while back on the deep copy stuff. I recall that the underlying logic for making this the default was related to a copied object not being a true copy (as defined by the Java specs?) unless the associated complex objects were copied. But my memory's prone to parity errors occationally... Anyway, if you don't care about a copy being exact to the level of the related objects, you can use: newRecord = record.copy(false); This will do a simpler and faster copy. If you use the copy to get related objects, only then will the cache be refilled. If you're code is slowing down with more data, turning on logging for Torque is a good idea. The logs will have a short version of all queries done and the time it took. This can let you quickly find the expensive queries that you need to look at. Generally, this means that you probably need to add an index or two on the where clause values. -Original Message- From: Federico Fissore [mailto:[EMAIL PROTECTED] Sent: Thursday, April 12, 2007 10:48 AM To: Apache Torque Users List Subject: Re: Torque is very slow to do a .copy of an object :( Why? Hidde Boonstra [Us Media] ha scritto: Hi, sorry, but I think that's what I mean:-) So if you have object1 and object2 which references to object1 and you do a copy on object1 it will also copy and add all object2 instances that refer to object1. It looks like this is recursive, because objects that refer to object2 will probably be copied as well... Hope this helps to explain your slowdown, Hidde. You may also want to turn on debugging on package org.apache.torque and see how many and what queries are you actually doing by copying your object. You may find that number surprising. - 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] -- View this message in context: http://www.nabble.com/Torque-is-very-slow-to-do-a-.copy-of-an-object-%3A%28-Why--tf3565099.html#a9973353 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Torque is very slow to do a .copy of an object :( Why?
Hi! Could you try a myObject1.copy(false) to avoid making a deepcopy. bye Thoralf I'm using torque to connect to my Mysql database. I'm trying to improve performence of my application and I saw that torque is taking more than 600 ms to execute a command like: - Object1 myCopiedObject1 = myObject1.copy(); - Torque is only slow if I have a lots of data in my DB. I cannot understand this! a copy should only do the work in memory and not access the DB. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Torque is very slow to do a .copy of an object :( Why?
I tried to use the function .copy(false) but apparently this one does not exists (I'm using torque 3.2-rc2) :( Alain Thoralf Rickert wrote: Hi! Could you try a myObject1.copy(false) to avoid making a deepcopy. bye Thoralf I'm using torque to connect to my Mysql database. I'm trying to improve performence of my application and I saw that torque is taking more than 600 ms to execute a command like: - Object1 myCopiedObject1 = myObject1.copy(); - Torque is only slow if I have a lots of data in my DB. I cannot understand this! a copy should only do the work in memory and not access the DB. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Torque-is-very-slow-to-do-a-.copy-of-an-object-%3A%28-Why--tf3565099.html#a9974840 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AW: Torque is very slow to do a .copy of an object :( Why?
Hmm, are you using a non-default build option of: torque.complexObjectModel=false That's the only way that the copy( boolean deepcopy) method would not be created in your BaseRecord object. If you are generating your OM layer with this set to false, then doing an OM object .copy() is just a simple memory to memory copy. And all the discusion of deepcopy isn't valid for you. -Original Message- From: philipina [mailto:[EMAIL PROTECTED] Sent: Friday, April 13, 2007 4:22 AM To: [EMAIL PROTECTED] Subject: Re: AW: Torque is very slow to do a .copy of an object :( Why? I tried to use the function .copy(false) but apparently this one does not exists (I'm using torque 3.2-rc2) :( Alain Thoralf Rickert wrote: Hi! Could you try a myObject1.copy(false) to avoid making a deepcopy. bye Thoralf I'm using torque to connect to my Mysql database. I'm trying to improve performence of my application and I saw that torque is taking more than 600 ms to execute a command like: - Object1 myCopiedObject1 = myObject1.copy(); - Torque is only slow if I have a lots of data in my DB. I cannot understand this! a copy should only do the work in memory and not access the DB. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Torque-is-very-slow-to-do-a-.copy-of-an- object-%3A%28-Why--tf3565099.html#a9974840 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. - 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: AW: Torque is very slow to do a .copy of an object :( Why?
Not sure... I can confirm that I do not have the copy(boolean) function but torque is doing a deep copy because when I save my copied object I also get a new entry in the table linked to the original objet. Alain Greg Monroe wrote: Hmm, are you using a non-default build option of: torque.complexObjectModel=false That's the only way that the copy( boolean deepcopy) method would not be created in your BaseRecord object. If you are generating your OM layer with this set to false, then doing an OM object .copy() is just a simple memory to memory copy. And all the discusion of deepcopy isn't valid for you. -Original Message- From: philipina [mailto:[EMAIL PROTECTED] Sent: Friday, April 13, 2007 4:22 AM To: [EMAIL PROTECTED] Subject: Re: AW: Torque is very slow to do a .copy of an object :( Why? I tried to use the function .copy(false) but apparently this one does not exists (I'm using torque 3.2-rc2) :( Alain Thoralf Rickert wrote: Hi! Could you try a myObject1.copy(false) to avoid making a deepcopy. bye Thoralf I'm using torque to connect to my Mysql database. I'm trying to improve performence of my application and I saw that torque is taking more than 600 ms to execute a command like: - Object1 myCopiedObject1 = myObject1.copy(); - Torque is only slow if I have a lots of data in my DB. I cannot understand this! a copy should only do the work in memory and not access the DB. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Torque-is-very-slow-to-do-a-.copy-of-an- object-%3A%28-Why--tf3565099.html#a9974840 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. - 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] -- View this message in context: http://www.nabble.com/Torque-is-very-slow-to-do-a-.copy-of-an-object-%3A%28-Why--tf3565099.html#a9983668 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]