亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? toplinktransactionmanager.java

?? spring framework 2.5.4源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright 2002-2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.orm.toplink;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import oracle.toplink.exceptions.DatabaseException;
import oracle.toplink.exceptions.TopLinkException;
import oracle.toplink.internal.databaseaccess.Accessor;
import oracle.toplink.internal.databaseaccess.DatabaseAccessor;
import oracle.toplink.sessions.Session;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.datasource.ConnectionHolder;
import org.springframework.jdbc.datasource.JdbcTransactionObjectSupport;
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
import org.springframework.jdbc.support.SQLExceptionTranslator;
import org.springframework.transaction.CannotCreateTransactionException;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.support.AbstractPlatformTransactionManager;
import org.springframework.transaction.support.DefaultTransactionStatus;
import org.springframework.transaction.support.ResourceTransactionManager;
import org.springframework.transaction.support.TransactionSynchronizationManager;

/**
 * {@link org.springframework.transaction.PlatformTransactionManager} implementation
 * for a single TopLink {@link SessionFactory}. Binds a TopLink Session from the
 * specified factory to the thread, potentially allowing for one thread-bound Session
 * per factory. {@link SessionFactoryUtils} and {@link TopLinkTemplate} are aware
 * of thread-bound Sessions and participate in such transactions automatically.
 * Using either of those or going through <code>Session.getActiveUnitOfWork()</code> is
 * required for TopLink access code supporting this transaction handling mechanism.
 *
 * <p>This transaction manager is appropriate for applications that use a single
 * TopLink SessionFactory for transactional data access. JTA (usually through
 * {@link org.springframework.transaction.jta.JtaTransactionManager}) is necessary
 * for accessing multiple transactional resources within the same transaction.
 * Note that you need to configure TopLink with an appropriate external transaction
 * controller in order to make it participate in JTA transactions.
 *
 * <p>This transaction manager also supports direct DataSource access within a transaction
 * (i.e. plain JDBC code working with the same DataSource), but only for transactions
 * that are <i>not</i> marked as read-only. This allows for mixing services which
 * access TopLink and services which use plain JDBC (without being aware of TopLink)!
 * Application code needs to stick to the same simple Connection lookup pattern as
 * with {@link org.springframework.jdbc.datasource.DataSourceTransactionManager}
 * (i.e. {@link org.springframework.jdbc.datasource.DataSourceUtils#getConnection}
 * or going through a
 * {@link org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy}).
 *
 * <p>Note: To be able to register a DataSource's Connection for plain JDBC code,
 * this instance needs to be aware of the DataSource ({@link #setDataSource}).
 * The given DataSource should obviously match the one used by the given TopLink
 * SessionFactory.
 *
 * <p>On JDBC 3.0, this transaction manager supports nested transactions via JDBC 3.0
 * Savepoints. The {@link #setNestedTransactionAllowed} "nestedTransactionAllowed"}
 * flag defaults to "false", though, as nested transactions will just apply to the
 * JDBC Connection, not to the TopLink PersistenceManager and its cached objects.
 * You can manually set the flag to "true" if you want to use nested transactions
 * for JDBC access code which participates in TopLink transactions (provided that
 * your JDBC driver supports Savepoints). <i>Note that TopLink itself does not
 * support nested transactions! Hence, do not expect TopLink access code to
 * semantically participate in a nested transaction.</i>
 *
 * <p>Thanks to Slavik Markovich for implementing the initial TopLink support prototype!
 *
 * @author Juergen Hoeller
 * @author <a href="mailto:james.x.clark@oracle.com">James Clark</a>
 * @since 1.2
 * @see #setSessionFactory
 * @see #setDataSource
 * @see LocalSessionFactoryBean
 * @see SessionFactoryUtils#getSession
 * @see SessionFactoryUtils#releaseSession
 * @see TopLinkTemplate
 * @see oracle.toplink.sessions.Session#getActiveUnitOfWork()
 * @see org.springframework.jdbc.datasource.DataSourceUtils#getConnection
 * @see org.springframework.jdbc.datasource.DataSourceUtils#applyTransactionTimeout
 * @see org.springframework.jdbc.datasource.DataSourceUtils#releaseConnection
 * @see org.springframework.jdbc.core.JdbcTemplate
 * @see org.springframework.jdbc.datasource.DataSourceTransactionManager
  * @see org.springframework.transaction.jta.JtaTransactionManager
 */
public class TopLinkTransactionManager extends AbstractPlatformTransactionManager
		implements ResourceTransactionManager, InitializingBean {

	private SessionFactory sessionFactory;

	private DataSource dataSource;

	private boolean lazyDatabaseTransaction = false;

	private SQLExceptionTranslator jdbcExceptionTranslator;


	/**
	 * Create a new TopLinkTransactionManager instance.
	 * A SessionFactory has to be specified to be able to use it.
	 * @see #setSessionFactory
	 */
	public TopLinkTransactionManager() {
	}

	/**
	 * Create a new TopLinkTransactionManager instance.
	 * @param sessionFactory the TopLink SessionFactory to manage transactions for
	 */
	public TopLinkTransactionManager(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
		afterPropertiesSet();
	}

	/**
	 * Set the the TopLink SessionFactory to manage transactions for.
	 * This will usually be a ServerSessionFactory.
	 * <p>The passed-in SessionFactory will be asked for a plain Session
	 * in case of a read-only transaction (where no active UnitOfWork is
	 * supposed to be available), and for a managed Session else (with an
	 * active UnitOfWork that will be committed by this transaction manager).
	 * @see ServerSessionFactory
	 * @see SessionFactory#createSession()
	 * @see SessionFactory#createManagedClientSession()
	 */
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	/**
	 * Return the SessionFactory that this instance should manage transactions for.
	 */
	public SessionFactory getSessionFactory() {
		return this.sessionFactory;
	}

	/**
	 * Set the JDBC DataSource that this instance should manage transactions for.
   * The DataSource should match the one used by the TopLink SessionFactory:
	 * for example, you could specify the same JNDI DataSource for both.
	 * <p>A transactional JDBC Connection for this DataSource will be provided to
	 * application code accessing this DataSource directly via DataSourceUtils
	 * or JdbcTemplate. The Connection will be taken from the TopLink Session.
	 * <b>This will only happen for transactions that are <i>not</i> marked
	 * as read-only.</b> TopLink does not support database transactions for pure
	 * read-only operations on a Session (that is, without a UnitOfWork).
	 * <p>Note that you need to use a TopLink Session with a DatabaseAccessor
	 * to allow for exposing TopLink transactions as JDBC transactions. This is
	 * the case of all standard TopLink configurations.
	 * <p>The DataSource specified here should be the target DataSource to manage
	 * transactions for, not a TransactionAwareDataSourceProxy. Only data access
	 * code may work with TransactionAwareDataSourceProxy, while the transaction
	 * manager needs to work on the underlying target DataSource. If there's
	 * nevertheless a TransactionAwareDataSourceProxy passed in, it will be
	 * unwrapped to extract its target DataSource.
	 * @see org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
	 * @see org.springframework.jdbc.datasource.DataSourceUtils
	 * @see org.springframework.jdbc.core.JdbcTemplate
	 */
	public void setDataSource(DataSource dataSource) {
		if (dataSource instanceof TransactionAwareDataSourceProxy) {
			// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
			// for its underlying target DataSource, else data access code won't see
			// properly exposed transactions (i.e. transactions for the target DataSource).
			this.dataSource = ((TransactionAwareDataSourceProxy) dataSource).getTargetDataSource();
		}
		else {
			this.dataSource = dataSource;
		}
	}

	/**
	 * Return the JDBC DataSource that this instance manages transactions for.
	 */
	public DataSource getDataSource() {
		return this.dataSource;
	}

	/**
	 * Set whether to lazily start a database transaction within a TopLink
	 * transaction.
	 * <p>By default, database transactions are started early. This allows
	 * for reusing the same JDBC Connection throughout an entire transaction,
	 * including read operations, and also for exposing TopLink transactions
	 * to JDBC access code (working on the same DataSource).
	 * <p>It is only recommended to switch this flag to "true" when no JDBC access
	 * code is involved in any of the transactions, and when it is acceptable to
	 * perform read operations outside of the transactional JDBC Connection.
	 * @see #setDataSource(javax.sql.DataSource)
	 * @see oracle.toplink.sessions.UnitOfWork#beginEarlyTransaction()
	 */
	public void setLazyDatabaseTransaction(boolean lazyDatabaseTransaction) {
		this.lazyDatabaseTransaction = lazyDatabaseTransaction;
	}

	/**
	 * Return whether to lazily start a database transaction within a TopLink
	 * transaction.
	 */
	public boolean isLazyDatabaseTransaction() {
		return this.lazyDatabaseTransaction;
	}

	/**
	 * Set the JDBC exception translator for this transaction manager.
	 * <p>Applied to any SQLException root cause of a TopLink DatabaseException
	 * that is thrown on commit. The default is to rely on TopLink's native
	 * exception translation.
	 * @param jdbcExceptionTranslator the exception translator
	 * @see oracle.toplink.exceptions.DatabaseException
	 * @see org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator
	 * @see org.springframework.jdbc.support.SQLStateSQLExceptionTranslator
	 * @see #setDataSource(javax.sql.DataSource)
	 */
	public void setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) {
		this.jdbcExceptionTranslator = jdbcExceptionTranslator;
	}

	/**
	 * Return the JDBC exception translator for this transaction manager, if any.
	 */
	public SQLExceptionTranslator getJdbcExceptionTranslator() {
		return this.jdbcExceptionTranslator;
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产免费久久| 国产成人免费视频网站高清观看视频| 日韩欧美123| 欧美久久免费观看| 制服丝袜亚洲网站| 欧美一区二区精品久久911| 88在线观看91蜜桃国自产| 欧美日韩综合不卡| 欧美一区国产二区| 日韩欧美在线影院| 久久久精品蜜桃| 欧美激情一区二区三区蜜桃视频 | 不卡av在线网| 99麻豆久久久国产精品免费| 91亚洲国产成人精品一区二区三| 一本一本大道香蕉久在线精品| 91在线免费看| 在线播放亚洲一区| 日本一区二区视频在线| 中文字幕一区二区三| 夜色激情一区二区| 免费的成人av| 成人丝袜18视频在线观看| 91最新地址在线播放| 欧美人伦禁忌dvd放荡欲情| 69p69国产精品| 国产拍揄自揄精品视频麻豆| 亚洲特级片在线| 午夜国产精品影院在线观看| 黑人精品欧美一区二区蜜桃| av一二三不卡影片| 欧美精品黑人性xxxx| 久久久久国产一区二区三区四区| 国产精品国产三级国产aⅴ原创| 亚洲激情六月丁香| 国产精品一区专区| 日本精品视频一区二区| 精品美女一区二区| 亚洲精品伦理在线| 麻豆专区一区二区三区四区五区| a亚洲天堂av| 久久综合色综合88| 一区二区三区日韩在线观看| 国产剧情一区二区| 欧美日韩不卡在线| 中文在线免费一区三区高中清不卡| 亚洲一区在线播放| 国产成都精品91一区二区三| 欧美日韩综合色| 亚洲日本在线a| 国产一区二区精品在线观看| 欧美色视频在线观看| 欧美极品xxx| 国产一区二区三区在线观看免费| 欧美亚洲自拍偷拍| 国产精品久久看| 国产一区啦啦啦在线观看| 欧美片在线播放| 一级女性全黄久久生活片免费| 国产高清无密码一区二区三区| 欧美日韩精品一区视频| 亚洲少妇最新在线视频| 国产成人啪午夜精品网站男同| 日韩欧美一区二区在线视频| 亚洲电影第三页| 91福利在线导航| 亚洲欧美日韩在线播放| 福利一区二区在线| 欧美激情一区二区三区四区| 国内精品久久久久影院色| 91精品国产一区二区人妖| 亚洲va国产va欧美va观看| 裸体健美xxxx欧美裸体表演| 亚洲日本一区二区| 91丨porny丨最新| 精品国产乱码久久久久久牛牛 | 91丨porny丨户外露出| 欧美激情综合五月色丁香小说| 国产精品自拍一区| 久久久久99精品一区| 久久99精品视频| 欧美成人精品高清在线播放| 精品一区二区三区在线播放| 欧美一级黄色录像| 国产高清在线精品| 亚洲欧洲性图库| 色国产精品一区在线观看| 亚洲视频 欧洲视频| 在线免费观看日韩欧美| 亚洲一区二区在线视频| 欧美日韩国产免费一区二区 | 日韩二区三区四区| 日韩天堂在线观看| 国产剧情一区二区| 亚洲乱码中文字幕综合| 欧美日韩一区二区在线视频| 日韩不卡一区二区| 国产亚洲午夜高清国产拍精品 | 欧美私模裸体表演在线观看| 日韩高清国产一区在线| 精品欧美乱码久久久久久1区2区| 免费人成网站在线观看欧美高清| 久久久久9999亚洲精品| 色又黄又爽网站www久久| 亚洲高清三级视频| 久久色在线观看| 色偷偷88欧美精品久久久| 视频一区视频二区中文字幕| 久久久午夜精品| 色噜噜狠狠一区二区三区果冻| 免费精品视频最新在线| 国产精品狼人久久影院观看方式| 在线一区二区视频| 国模大尺度一区二区三区| 亚洲色图.com| 日韩欧美国产麻豆| 91久久香蕉国产日韩欧美9色| 蜜桃视频在线观看一区二区| 亚洲欧美在线视频| 欧美不卡一区二区三区| 99视频国产精品| 韩国av一区二区三区四区 | 蜜桃精品视频在线| 亚洲免费在线观看| 精品成人私密视频| 欧美三级电影一区| 91亚洲精品久久久蜜桃网站| 精品在线观看视频| 亚洲成人1区2区| 综合中文字幕亚洲| 国产人久久人人人人爽| 欧美伊人久久大香线蕉综合69 | 国产99久久久久| 久久99久久久欧美国产| 亚洲成人三级小说| 亚洲丝袜自拍清纯另类| 久久精品一区二区三区不卡| 在线成人高清不卡| 91久久国产最好的精华液| 成人动漫中文字幕| 国产永久精品大片wwwapp| 另类中文字幕网| 蜜桃在线一区二区三区| 五月天丁香久久| 午夜精品久久久久久久久| 一区二区视频免费在线观看| 亚洲同性同志一二三专区| 欧美激情一区二区三区不卡| 26uuu亚洲综合色| 日韩精品在线看片z| 4438x成人网最大色成网站| 欧美性生活久久| 欧洲亚洲精品在线| 欧美三级乱人伦电影| 欧美乱熟臀69xxxxxx| 欧美性视频一区二区三区| 欧美日韩免费高清一区色橹橹 | 国产成人一区在线| 国产精品一线二线三线精华| 韩国av一区二区三区在线观看| 狠狠色狠狠色综合| 成人黄色小视频| 91麻豆国产在线观看| 色综合久久久久久久久| 欧美伊人久久久久久久久影院| 欧美精品 日韩| 欧美精品一区二区久久久| 国产三区在线成人av| 国产精品蜜臀在线观看| 亚洲女女做受ⅹxx高潮| 亚洲高清三级视频| 久草热8精品视频在线观看| 懂色av一区二区三区蜜臀| 97久久精品人人做人人爽| 欧美性生交片4| 日韩三级视频在线观看| 国产亚洲成年网址在线观看| 中文字幕五月欧美| 五月天视频一区| 国产一区二区不卡| 91小视频在线| 日韩欧美一区二区视频| 中文字幕巨乱亚洲| 三级亚洲高清视频| 懂色av一区二区在线播放| 91精品1区2区| 久久久久久久综合日本| 亚洲黄色免费网站| 国产精品亚洲一区二区三区妖精| 91小视频在线观看| 2021久久国产精品不只是精品| 亚洲免费观看高清| 国产在线观看免费一区| 在线亚洲人成电影网站色www| 日韩免费观看高清完整版在线观看| 国产精品免费视频一区| 香蕉成人啪国产精品视频综合网| 国产成人鲁色资源国产91色综| 欧美色综合网站| 国产精品久久久久久久久免费樱桃|