Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-2049

Database connection closed after first @Test/@UsingDataSet in a class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • persistence_1.0.0.next, persistence_1.0.0.Alpha7
    • None
    • Hide

      I can upload my code to gihub if needed

      Show
      I can upload my code to gihub if needed

      Once ARQ-2042 was resolved, I rebuilt arquillian-persistence against the new arquillian-core
      and ran into a problem where the database connection was being closed once the first test
      in my class had finished. I see the same pattern in some of the integration tests so I don't
      know what is different with my environment (other than openejb-embedded).

      After a lot of debugging I finally narrowed the problem down to this change from Alpha6:

      	private void createDatabaseConnection() {
      
      		try {
      			if (databaseConnectionProducer.get() != null
      					&& !databaseConnectionProducer.get().getConnection().isClosed()) {
      				closeDatabaseConnection();
      			}
      

      to Alpha7:

          private void createDatabaseConnection() {
      
      		if (databaseConnectionProducer.get()== null) {
                  configureDatabaseConnection();
              }
      
          }
      
          private void configureDatabaseConnection() {
              try {
      

            bartosz-1 Bartosz Majsak
            lindholm_jira George Lindholm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: