Quick question that I can't find an answer to. If you have a connection pool where some connections may have been set to autocommit false. If those are returned and retrieved from the pool. Is autocommit set back to true (the default)? Or is it that I could have some connections in one mode or the other?
java connection pool and autocommit status
1.4k Views Asked by sproketboy At
1
There are 1 best solutions below
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in JDBC
- Hibernate ClobJdbcType bindings: what are the diferences?
- Update a MySQL row depending on the ID in Google Sheets Apps Script
- How RowSet works java?
- java ee jdbc jstl servlet connection to db
- VSCode Libraries not showing for New Java Project
- Is there any guide online on how to correctly map the sakila database using Java and hibernate?
- Java cancel task running Oracle query through JDBC - connection broken because of SQLSTATE(08006), ErrorCode(17002) IO Error: Socket read interrupted
- Ibm Db2 Jdbc Connection
- How to connect to mysql inside a Kubernetes cluster?
- How to specify multiple databases when connecting to DolphinDB Server with JDBC interface?
- Connecting to MS SQL DB from Java thows error
- Access denied for user 'root'@'localhost' (using password: YES) in eclipse when connecting with jdbc
- databricks / pycharm sql connection
- How to correctly insert a jsonb into postgresql using a Java PreparedStatement
- How to query jsonb column with spring data
Related Questions in DATASOURCE
- Already value [datasource.ConnectionHolder@6b144bd8] for key [datasource.DriverManagerDataSource@56739ee9] bound to thread [main]
- Iterating Over Object Keys in Freemarker Templates with SuiteScript 2.1 Custom Data Source
- How to reference the default DataSource from another one?
- I keep getting a "NoClassDefFound" error with Weka Ai using Java. I keep getting this Error?
- I don't know how to use DataSource instead of createConnection
- Field repository in [package] required a bean named 'entityManagerFactory' that could not be found
- VB.Net DataGridView change makes DataSource change
- I'm having problems with Angular data transfer with API
- How to format dsn with sf package
- ThreadLocal context lost with CompletableFuture in Java
- Add timestamp column to panel in Grafana
- Tomcat server not starting!- Spring application - Upgrade from JDK8 to JDK17
- Azure Dataflow - Resource references resources which could not be loaded
- Trying to clone mat-table nested datasource.data in angular
- Hardcode password in application.yml Fortify issue
Related Questions in DBCP
- Cannot get a connection, pool error Timeout waiting for idle object while using DBPC2
- DBCP connection property name issue
- How should I connect my web app in java with the database? With jdbc coming from a jar file in referenced libraries or dbcp?
- SQL Server returned an incomplete response. The connection has been closed.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException:
- BasicDataSource Support domain name?
- how to reload password in dbcp basic datasource
- Java BasicDataSource getting stuck when connecting
- Connecting to Cassandra using Java DBCP
- Java and MariaDB connection drivers errors
- java connection pool and autocommit status
- Concurrency logging to sql DB - threads not running parallel
- Getting error on shutdown of simple Micronaut CLI data application
- setting connectionTimedOut to 1 sec is throwing Socket Timed Out error
- java dbcp2 multithreaded connection access
- Apache felix cannot load dbcp2 as bundle
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
A properly behaving connection pool should always return connections in the same clean state. Which, assuming defaults specified in the JDBC specification, would be that a connection has no outstanding transaction and is in auto-commit mode.
However, historically this has been a bit of a mess, and some connection pools will not rollback outstanding transactions when a connection is returned to the pool, nor reset the current auto-commit mode, or they need to be explicitly configured to do so. Some do this for performance reasons, but from a pure JDBC standpoint, such behaviour is incorrect.
It is always advisable to check the documentation and verify (test) the behaviour of a data source, and not blindly rely on assumptions.
DBCP will by default call
setAutoCommit(true)when a connection is returned (settingenableAutoCommitOnReturn) and rollback outstanding transactions (settingrollbackOnReturn). See also BasicDataSource Configuration Parameters.