@@ -99,8 +99,8 @@ public SessionFactory createEntityManagerFactory() {
9999 }
100100
101101 /**
102- * JDBC driver class name for non-{@link javax.sql.DataSource DataSource}
103- * connection .
102+ * JDBC driver class name. This setting is ignored when Hibernate is configured
103+ * to obtain connections from a {@link javax.sql.DataSource} .
104104 *
105105 * @see #JDBC_DRIVER
106106 */
@@ -110,7 +110,8 @@ public HibernatePersistenceConfiguration jdbcDriver(String driverName) {
110110 }
111111
112112 /**
113- * JDBC URL of non-{@link javax.sql.DataSource DataSource} JDBC connection.
113+ * JDBC URL. This setting is ignored when Hibernate is configured to obtain
114+ * connections from a {@link javax.sql.DataSource}.
114115 *
115116 * @see #JDBC_URL
116117 */
@@ -120,35 +121,40 @@ public HibernatePersistenceConfiguration jdbcUrl(String url) {
120121 }
121122
122123 /**
123- * Username for non-{@link javax.sql.DataSource DataSource} JDBC connection .
124+ * Username for JDBC authentication .
124125 *
125126 * @see #JDBC_USER
126127 * @see #jdbcPassword
128+ * @see java.sql.DriverManager#getConnection(String, String, String)
129+ * @see javax.sql.DataSource#getConnection(String, String)
127130 */
128131 public HibernatePersistenceConfiguration jdbcUsername (String username ) {
129132 property ( JDBC_USER , username );
130133 return this ;
131134 }
132135
133136 /**
134- * Password for non-{@link javax.sql.DataSource DataSource} JDBC connection .
137+ * Password for JDBC authentication .
135138 *
136139 * @see #JDBC_PASSWORD
137140 * @see #jdbcUsername
141+ * @see java.sql.DriverManager#getConnection(String, String, String)
142+ * @see javax.sql.DataSource#getConnection(String, String)
138143 */
139144 public HibernatePersistenceConfiguration jdbcPassword (String password ) {
140145 property ( JDBC_PASSWORD , password );
141146 return this ;
142147 }
143148
144149 /**
145- * Username and password for non-{@link javax.sql.DataSource DataSource}
146- * JDBC connection.
150+ * Username and password for JDBC authentication.
147151 *
148152 * @see #JDBC_USER
149153 * @see #JDBC_PASSWORD
150154 * @see #jdbcUsername
151155 * @see #jdbcPassword
156+ * @see java.sql.DriverManager#getConnection(String, String, String)
157+ * @see javax.sql.DataSource#getConnection(String, String)
152158 */
153159 public HibernatePersistenceConfiguration jdbcCredentials (String username , String password ) {
154160 jdbcUsername ( username );
@@ -157,7 +163,8 @@ public HibernatePersistenceConfiguration jdbcCredentials(String username, String
157163 }
158164
159165 /**
160- * The JDBC connection pool size.
166+ * The JDBC connection pool size. This setting is ignored when Hibernate is
167+ * configured to obtain connections from a {@link javax.sql.DataSource}.
161168 *
162169 * @see JdbcSettings#POOL_SIZE
163170 */
@@ -166,6 +173,36 @@ public HibernatePersistenceConfiguration jdbcPoolSize(int poolSize) {
166173 return this ;
167174 }
168175
176+ /**
177+ * The JDBC {@linkplain java.sql.Connection#setAutoCommit autocommit mode}
178+ * for pooled connections. This setting is ignored when Hibernate is
179+ * configured to obtain connections from a {@link javax.sql.DataSource}.
180+ *
181+ * @see JdbcSettings#AUTOCOMMIT
182+ */
183+ public HibernatePersistenceConfiguration jdbcAutocommit (boolean autocommit ) {
184+ property ( JdbcSettings .AUTOCOMMIT , autocommit );
185+ return this ;
186+ }
187+
188+ /**
189+ * The JDBC {@linkplain java.sql.Connection#setTransactionIsolation transaction
190+ * isolation level}. This setting is ignored when Hibernate is configured to
191+ * obtain connections from a {@link javax.sql.DataSource}.
192+ * <p>
193+ * Possible values are enumerated by {@link java.sql.Connection}:
194+ * {@link java.sql.Connection#TRANSACTION_READ_UNCOMMITTED},
195+ * {@link java.sql.Connection#TRANSACTION_READ_COMMITTED},
196+ * {@link java.sql.Connection#TRANSACTION_REPEATABLE_READ}, and
197+ * {@link java.sql.Connection#TRANSACTION_SERIALIZABLE}.
198+ *
199+ * @see JdbcSettings#ISOLATION
200+ */
201+ public HibernatePersistenceConfiguration jdbcTransactionIsolation (int isolationLevel ) {
202+ property ( JdbcSettings .ISOLATION , isolationLevel );
203+ return this ;
204+ }
205+
169206 /**
170207 * Enables SQL logging to the console.
171208 * <p>
0 commit comments