Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1436

Should mention use of openjpa.ConnectionFactory2Name and openjpa.ConnectionFactoryName in a testing section

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.1
    • None
    • docs
    • None

    Description

      I suppose a higher-level point that should be made is that the doc should have a section on "testing", covering issues specific to OpenJPA that facilitate or hinder testing. The particular point I wanted to make is that if you need to override the "jta-data-source" or "non-jta-data-source" in a test (or anywhere), the properties "openjpa.ConnectionFactory2Name" and/or "openjpa.ConnectionFactoryName" need to be set, very likely to the empty string.

      For instance, my application uses "non-jta-data-source" to connect to a JNDI datasource in WebLogic, which connects to Oracle. However, my database tests use an embedded instance of Apache Derby. In my test setup, I pass properties to the EntityManagerFactory creation that specifies the database connection, but I had to know to set those two properties (just the "2" one, in my case) to empty strings, to cause it to not try to look up the datasource from JNDI.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dkarr David M. Karr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: