Skip to content

Invalid WARNING: Closing open connection prior to commit #6770

@bcluap

Description

@bcluap

Describe the bug
Logs are showing an invalid error when doing user local transaction management and committing a transaction. Does not happen in 1.2.0.CR1 but does on 999-SNAPSHOT
2020-01-24 16:09:46,216 WARN [io.agr.pool] (executor-thread-27) Datasource '': Closing open connection prior to commit

Expected behavior
This should not be logged

Actual behavior
Logs show:
2020-01-24 16:09:46,216 WARN [io.agr.pool] (executor-thread-27) Datasource '': Closing open connection prior to commit

To Reproduce
Steps to reproduce the behavior:

  1. Run an app that uses resource local transactions. E.g.

@path("/hello1")
@RequestScoped
public class GreetingResource1 {

@Inject
EntityManagerFactory myEmf;

@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
    
    EntityManager em = myEmf.createEntityManager();
    em.getTransaction().begin();
    em.createNativeQuery("SELECT 1").getResultList();
    em.getTransaction().commit();
    em.close();
    
    return "hello1";
}

}
2) Call the rest endpoint and the logs will show the warnng when the line "em.getTransaction().commit();" is called

Configuration

# Add your application.properties here, if applicable.
Just standard props file to connect to a DB

**Screenshots**
NA

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: Linux PCBLaptop 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
 - Output of `java -version`: openjdk version "11.0.5" 2019-10-15
 - GraalVM version (if different from Java): NA
 - Quarkus version or git rev: 999-SNAPSHOT

**Additional context**
I only noticed this today. Yesterday it was fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions