Hi,

I'm developing an opennms extension.
In my code I need to load a Node object and verify the isDown() method.

To do that, I've used the nodeDao.load() with the Id of the Node.
The node is loaded correctly but when I invoked the isDown() method I
receive a Lazy Inizialization Exception about the Interface class.

To avoid that I try to recreate a myDao whit this method:

  @Override
  public OnmsNode load(Integer id) {
    Session session = getSession();
    OnmsNode node = (OnmsNode)session.load( OnmsNode.class, id );
    // Force loading of interfaces and other things...
    if ( node != null )
    {
      node.isDown();
    }
    releaseSession(session);
    return node;
  }

But this solution is not so clear... There is another nice solution to load
object FULLY (with all the internal object initialize) on OpenNMS sources? I
need that also for other objects like MonitoredServices and so on.

Thank you very much
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to