Dan,

Looks like the problem is with the DB layer.  It doesn't actually retrieve the 
value stored in the vo object but instead records the value passed to the vo 
object when the set method is called.  So it assumes the value being passed is 
the value is stored.  For now, best to make the change outside of the VO object.

--Alex

> -----Original Message-----
> From: Daan Hoogland [mailto:dhoogl...@schubergphilis.com]
> Sent: Wednesday, June 12, 2013 4:36 PM
> To: dev@cloudstack.apache.org
> Subject: RE: help on db code wanted
> 
> Dear readers,
> 
> I have some logging stating that I change the value in the VO, and then a db
> update using the double quotes anyway, as if the VO is not the actual object
> used for the update. Note the two 2F2F (double 2F's) in the
> template_host_ref.install_path in the last log line.
> 
> 2013-06-13 01:19:54,411 INFO  [cloud.storage.VMTemplateHostVO]
> (AgentManager-Handler-7:null) new install_path for VMTemplateHost:
> template/tmpl//2/208//59a1a94e-d69e-37e2-adb4-2e14472c3890.vhd
> changed into template/tmpl/2/208/59a1a94e-d69e-37e2-adb4-
> 2e14472c3890.vhd
> 
> 2013-06-13 01:19:54,427 TRACE [db.Transaction.Statement] (AgentManager-
> Handler-7:null) Preparing: UPDATE template_host_ref SET
> template_host_ref.local_path=?, template_host_ref.job_id=?,
> template_host_ref.physical_size=?, template_host_ref.download_pct=?,
> template_host_ref.install_path=?, template_host_ref.last_updated=?,
> template_host_ref.download_state=?, template_host_ref.error_str=?,
> template_host_ref.size=? WHERE template_host_ref.id = ?
> 
> 2013-06-13 01:19:54,427 TRACE [db.Transaction.Statement] (AgentManager-
> Handler-7:null) Closing: com.mysql.jdbc.JDBC4PreparedStatement@142e688:
> UPDATE template_host_ref SET
> template_host_ref.local_path=x'2F6D6E742F53656353746F726167652F356139
> 30333963662D363337612D333737302D623634342D616264376163353565663237
> 2F74656D706C6174652F746D706C2F322F3230382F646E6C643835313733323938
> 3730303434373233333537746D705F',
> template_host_ref.job_id=x'36303563303331342D666532332D343231662D61
> 3663322D313662396532626535303664', template_host_ref.physical_size=0,
> template_host_ref.download_pct=100,
> template_host_ref.install_path=x'74656D706C6174652F746D706C2F2F322F32
> 30382F2F35396131613934652D643639652D333765322D616462342D3265313434
> 373263333839302E766864', template_host_ref.last_updated='2013-06-12
> 23:19:54', template_host_ref.download_state='DOWNLOAD_IN_PROGRESS',
> template_host_ref.error_str=x'446F776E6C6F616420737563636573732C20737
> 4617274696E6720696E7374616C6C20', template_host_ref.size=0 WHERE
> template_host_ref.id = 16
> 
> Who has got the magic word for me?
> 
> Regards,
> 
> -----Original Message-----
> From: Daan Hoogland [mailto:dhoogl...@schubergphilis.com]
> Sent: donderdag 13 juni 2013 1:08
> To: dev@cloudstack.apache.org
> Subject: RE: help on db code wanted
> 
> Ok,
> 
> 2013-06-13 00:54:21,841 INFO  [cloud.utils.LogUtils] (main:null) log4j
> configuration found at
> C:\Users\dhoogland\cloudstack\cloudstack\client\target\cloud-client-ui-
> 4.2.0-SNAPSHOT\WEB-INF\classes\log4j-cloud.xml
> 
> This is from the vmops.log. guess this must be the one.
> 
> -----Original Message-----
> From: Alex Huang [mailto:alex.hu...@citrix.com]
> Sent: donderdag 13 juni 2013 1:04
> To: dev@cloudstack.apache.org
> Subject: RE: help on db code wanted
> 
> When you're debugging, you should modify the log4j-cloud.xml that jetty is
> reading.  I can't remember where it is by default.  I have to find this file
> everytime but it's not any of the files you find in the source as it is 
> copied to
> some jetty deployment directory.  Maybe someone knows where that file is.
> If not, if you're on linux, you can always find out by doing a lsof on the 
> java
> process and see which log4j-cloud.xml it is using.  I assume you can do
> something similar on the mac.  On windows, there's a utility called handle
> from system internals package that will tell you.
> 
> Doing this means you'll lose your setting everytime you do a  mvn clean 
> install.
> So editing one of the files in the source tree will give you a more permanent
> solution.  However, you have to be careful not to check it in.
> 
> BTW, CloudStack gets updated live on logging configs so there's no need to
> restart cloudstack after you change the configuration.  Just edit the file and
> save and within a minute or so, cloudstack will use the new logging
> configuration.
> 
> --Alex
> 
> > -----Original Message-----
> > From: Daan Hoogland [mailto:dhoogl...@schubergphilis.com]
> > Sent: Wednesday, June 12, 2013 3:48 PM
> > To: dev@cloudstack.apache.org
> > Subject: RE: help on db code wanted
> >
> > Glad to be teaching for a change;) quite common greeting in dutch if
> > you don't know how to start.
> >
> > About the log4j-cloud file. There is a lot of them. I suppose I chose
> > the one from secondary-storage and they all get picked up?  I also see
> some .in files.
> > No need to worry about those?
> >
> > -----Original Message-----
> > From: Alex Huang [mailto:alex.hu...@citrix.com]
> > Sent: donderdag 13 juni 2013 0:44
> > To: dev@cloudstack.apache.org
> > Subject: RE: help on db code wanted
> >
> > Nice...learn something new every day.
> >
> > --Alex
> >
> > > -----Original Message-----
> > > From: Daan Hoogland [mailto:dhoogl...@schubergphilis.com]
> > > Sent: Wednesday, June 12, 2013 3:36 PM
> > > To: dev@cloudstack.apache.org
> > > Subject: RE: help on db code wanted
> > >
> > > Thanks Alex,
> > >
> > > I didn't think of live stock yet, but that is a good backronym as
> > > well. The original is latin : lectori salutem (I hope I have the
> > > inclinations right) meaning readers be greeted
> > >
> > > -----Original Message-----
> > > From: Alex Huang [mailto:alex.hu...@citrix.com]
> > > Sent: donderdag 13 juni 2013 0:31
> > > To: dev@cloudstack.apache.org
> > > Subject: RE: help on db code wanted
> > >
> > > Daan,
> > >
> > > You can enable trace logging on the category
> > > "com.cloud.utils.db.Transaction.Statement" in log4j-cloud.xml.  It
> > > will log every SQL statement sent to the DB.  Look for update to the
> > > specific table, that will give you an indication what the db layer
> > > thinks is being set.  The logs grow very quickly with this on though.
> > >
> > > BTW,  what does LS mean?  Are you referring to us as some sort of
> > > animal farm characters (Live Stock)?
> > >
> > > --Alex
> > >
> > > > -----Original Message-----
> > > > From: Daan Hoogland [mailto:daan.hoogl...@gmail.com]
> > > > Sent: Wednesday, June 12, 2013 3:13 PM
> > > > To: dev
> > > > Subject: help on db code wanted
> > > >
> > > > LS,
> > > >
> > > >
> > > > I am trying to remove a double slash from the field install_path
> > > > in the table template_host_ref. It would seem to me that this can
> > > > be done by removing it in the VMTemplateHostVO, that gets used by
> > > > the VMTemplateHostDao to write to the database. I added a fixPath
> > > > function that I stole from some other class and had it log to see
> > > > if the expected fixup happened. The log line comes by but the
> > > > database gets filled with the double slashes anyhow. Is the
> > > > database filled from another
> > > class then the VO/Dao/DaoImpl combination?
> > > >
> > > >
> > > > Many thanks,
> > > >
> > > > Daan

Reply via email to