Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-911

ORM attribute "lazy=true" in one-to-many property fails

    Details

    • Steps to Reproduce:
      Hide

      Use the CFC above and try and load it with lazy="true". Code for the "tag" object follows:

      <cfcomponent name="Tag" persistent="true" table="tag">
      <cfproperty name="id" fieldtype="id" ormtype="integer" generator="native" />
      <cfproperty name="name" />
      <cfproperty name="server_id" />
      </cfcomponent>

      Show
      Use the CFC above and try and load it with lazy="true". Code for the "tag" object follows: <cfcomponent name="Tag" persistent="true" table="tag"> <cfproperty name="id" fieldtype="id" ormtype="integer" generator="native" /> <cfproperty name="name" /> <cfproperty name="server_id" /> </cfcomponent>
    • Workaround Description:
      Hide

      No workaround, this was a workaround so that many items weren't loaded

      Show
      No workaround, this was a workaround so that many items weren't loaded

      Description

      I have an object that seems to be loading all the child elements in a one-to-many relationship. So to stop this I add:
      CFML:
      <cfcomponent name="Server" persistent="true" table="server">
      <cfproperty name="id" fieldtype="id" ormtype="integer" generator="native" />
      <cfproperty name="name" />
      <cfproperty name="version" />

      <!--- adding lazy makes this fail --->
      <cfproperty name="tags" type="array" fieldtype="one-to-many" cfc="Tag" fkcolumn="server_id" lazy="true"/>

      </cfcomponent>

      And I get the following error:

      Stack trace:
      44145 [btpool0-7] ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML String(138) Attribute "lazy" with value "proxy" must have a value from the list "true false extra ".
      invalid mapping
      at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.validateDTDattribute(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
      at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at org.dom4j.io.SAXReader.read(SAXReader.java:465)
      at org.dom4j.io.SAXReader.read(SAXReader.java:365)
      at org.hibernate.cfg.Configuration.addXML(Configuration.java:537)
      at railo.runtime.orm.hibernate.HibernateSessionFactory.createConfiguration(HibernateSessionFactory.java:93)
      at railo.runtime.orm.hibernate.HibernateORMEngine.getSessionFactory(HibernateORMEngine.java:198)
      at railo.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:90)
      at railo.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2936)
      at railo.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2926)
      at railo.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:45)
      at railo.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:502)
      at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114)
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23)
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1848)
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280)
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:493)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:913)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
      at org.hibernate.cfg.Configuration.addXML(Configuration.java:540)
      at railo.runtime.orm.hibernate.HibernateSessionFactory.createConfiguration(HibernateSessionFactory.java:93)
      at railo.runtime.orm.hibernate.HibernateORMEngine.getSessionFactory(HibernateORMEngine.java:198)
      at railo.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:90)
      at railo.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2936)
      at railo.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2926)
      at railo.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:45)
      at railo.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:502)
      at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114)
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23)
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1848)
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280)
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:493)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:913)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
      at railo.runtime.op.Caster.toPageException(Caster.java:2967)
      at railo.runtime.orm.hibernate.HibernateORMEngine.getSessionFactory(HibernateORMEngine.java:201)
      at railo.runtime.orm.hibernate.HibernateORMEngine.init(HibernateORMEngine.java:90)
      at railo.runtime.config.ConfigImpl.getORMEngine(ConfigImpl.java:2936)
      at railo.runtime.config.ConfigImpl.resetORMEngine(ConfigImpl.java:2926)
      at railo.runtime.orm.ORMUtil.resetEngine(ORMUtil.java:45)
      at railo.runtime.listener.ModernAppListener.initApplicationContext(ModernAppListener.java:502)
      at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114)
      at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23)
      at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1848)
      at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:280)
      at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
      at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:493)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:913)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                markdrew Mark Drew
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: