2 Replies Latest reply on May 23, 2008 11:24 PM by dan.j.allen

    why so many configs??

    elhanan

      hi all, i've been trying to use seam, and i noticed that my database connections settings are scattered across 3
      places!!


      1. hibernate-console.properties
      2. resources/projectname-ds.xml which does not get copied/deployed automatically to jboss (so if i change it in eclipse , i have to change manually in jboss, which caused my problems with deployment
      3. persistence.xml


      so my database changes, if have to change it 3 times.

        • 1. Re: why so many configs??
          stephen

          This has nothing to do with Seam at all.

          • 2. Re: why so many configs??
            dan.j.allen

            There are three configurations because these are three distinct parts of Java EE (and in one case Seam).


            You have to have a persistence unit descriptor (persistence.xml or hibernate.cfg.xml) to use JPA or Hibernate.


            You don't need the JCA data source configuration, though it is recommended. As an alternative, you can put your database connection information inside of the persistence unit descriptor, thus reducing one configuration file.


            Seam has to know how to hookup with the persistence unit to use a Seam-managed persistence context. To eliminate this configuration, use @PersistenceContext on a SFSB.


            So, its possible to get it down to one configuration, the persistence unit descriptor.