Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    replace hibernate.cfg.xml

    Hi all

    We have PowerEdition of smartgwt
    Browsers: all

    Currently, we use hibernate.cfg.xml for liveGrid and ha-xa-datasource for our EJB. We pack hibernate.cfg.xml in a war file. Is it possible to use JBoss datasource "ha-xa-datasource" instead of hibernate.cfg for liveGrid?

    Regards
    Miodrag

    #2
    Hi,

    First let's make it clear: hibernate.cfg.xml file has configuration for hibernate subsystem (connection, mapped classes, caching, hibernate specific properties etc.). It is not the same as JBoss data source configuration. So you can not discard hibernate.cfg.xml.

    Now let's correct your question: can you configure hibernate so that it would use data source configured in JBoss? Yes you can do it via JNDI. Check hibernate configuration docs:
    http://docs.jboss.org/hibernate/orm/...html/ch03.html

    Look for property: hibernate.connection.datasource

    Regards,
    Alius

    Comment

    Working...
    X