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

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

?? toplinkinterceptor.java

?? spring framework 2.5.4源代碼
?? JAVA
字號:
/*
 * Copyright 2002-2006 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 oracle.toplink.exceptions.TopLinkException;
import oracle.toplink.sessions.Session;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import org.springframework.transaction.support.TransactionSynchronizationManager;

/**
 * This interceptor binds a new TopLink Session to the thread before a method
 * call, closing and removing it afterwards in case of any method outcome.
 * If there already is a pre-bound Session (e.g. from TopLinkTransactionManager,
 * or from a surrounding TopLink-intercepted method), the interceptor simply
 * takes part in it.
 *
 * <p>Application code must retrieve a TopLink Session via the
 * <code>SessionFactoryUtils.getSession</code> method or - preferably -
 * TopLink's own <code>Session.getActiveSession()</code> method, to be able to
 * detect a thread-bound Session. Typically, the code will look like as follows:
 *
 * <pre>
 * public void doSomeDataAccessAction() {
 *   Session session = this.serverSession.getActiveSession();
 *   ...
 * }</pre>
 *
 * Note that this interceptor automatically translates TopLinkExceptions,
 * via delegating to the <code>SessionFactoryUtils.convertTopLikAccessException</code>
 * method that converts them to exceptions that are compatible with the
 * <code>org.springframework.dao</code> exception hierarchy (like TopLinkTemplate does).
 * This can be turned off if the raw exceptions are preferred.
 *
 * <p>This class can be considered a declarative alternative to TopLinkTemplate's
 * callback approach. The advantages are:
 * <ul>
 * <li>no anonymous classes necessary for callback implementations;
 * <li>the possibility to throw any application exceptions from within data access code.
 * </ul>
 *
 * <p>The drawback is the dependency on interceptor configuration. However, note
 * that this interceptor is usually <i>not</i> necessary in scenarios where the
 * data access code always executes within transactions. A transaction will always
 * have a thread-bound Session in the first place, so adding this interceptor to the
 * configuration just adds value when potentially executing outside of transactions
 * and/or when relying on exception translation.
 *
 * @author Juergen Hoeller
 * @since 1.2
 */
public class TopLinkInterceptor extends TopLinkAccessor implements MethodInterceptor {

	private boolean exceptionConversionEnabled = true;


	/**
	 * Set whether to convert any TopLinkException raised to a Spring DataAccessException,
	 * compatible with the <code>org.springframework.dao</code> exception hierarchy.
	 * <p>Default is "true". Turn this flag off to let the caller receive raw exceptions
	 * as-is, without any wrapping.
	 * @see org.springframework.dao.DataAccessException
	 */
	public void setExceptionConversionEnabled(boolean exceptionConversionEnabled) {
		this.exceptionConversionEnabled = exceptionConversionEnabled;
	}


	public Object invoke(MethodInvocation methodInvocation) throws Throwable {
		boolean existingTransaction = false;
		Session session = SessionFactoryUtils.getSession(getSessionFactory(), true);
		if (TransactionSynchronizationManager.hasResource(getSessionFactory())) {
			logger.debug("Found thread-bound Session for TopLink interceptor");
			existingTransaction = true;
		}
		else {
			logger.debug("Using new Session for TopLink interceptor");
			TransactionSynchronizationManager.bindResource(getSessionFactory(), new SessionHolder(session));
		}
		try {
			return methodInvocation.proceed();
		}
		catch (TopLinkException ex) {
			if (this.exceptionConversionEnabled) {
				throw convertTopLinkAccessException(ex);
			}
			else {
				throw ex;
			}
		}
		finally {
			if (existingTransaction) {
				logger.debug("Not closing pre-bound TopLink Session after interceptor");
			}
			else {
				TransactionSynchronizationManager.unbindResource(getSessionFactory());
				SessionFactoryUtils.releaseSession(session, getSessionFactory());
			}
		}
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本大道久久a久久精二百| 成人h动漫精品一区二区| 一区二区视频在线| 中文字幕日本乱码精品影院| 中文字幕色av一区二区三区| 中文字幕av一区二区三区高 | 一级女性全黄久久生活片免费| 国产欧美一区二区在线观看| 久久久欧美精品sm网站| 久久精品人人爽人人爽| 国产精品国产三级国产三级人妇| 欧美高清在线精品一区| 国产精品高潮久久久久无| 一区二区三区在线播放| 日韩综合小视频| 国产美女视频91| 色综合久久精品| 欧美精品久久天天躁| 日韩精品一区二区三区视频播放| 久久久久一区二区三区四区| 中文字幕一区在线| 日韩二区三区四区| 风间由美一区二区三区在线观看 | 国产精品国产三级国产普通话99| 亚洲人午夜精品天堂一二香蕉| 亚洲精品欧美专区| 秋霞成人午夜伦在线观看| 国产精品综合二区| 在线观看www91| 精品国产凹凸成av人网站| 亚洲视频在线一区| 青青草成人在线观看| 成人动漫一区二区在线| 欧美喷潮久久久xxxxx| 久久―日本道色综合久久| 亚洲激情一二三区| 国产一区啦啦啦在线观看| 欧美亚洲动漫精品| 精品国产一区久久| 午夜久久久久久久久| 国产99精品在线观看| 制服丝袜亚洲网站| 国产精品福利一区| 国产乱子伦一区二区三区国色天香 | 欧美日韩国产影片| 中文字幕在线一区免费| 国产在线麻豆精品观看| 色欧美88888久久久久久影院| 日韩午夜av电影| 亚洲一二三四久久| 成人黄色网址在线观看| 日韩欧美在线综合网| 亚洲国产精品久久人人爱| 成人性生交大合| 亚洲精品在线观看视频| 香蕉久久夜色精品国产使用方法| caoporn国产一区二区| 久久色在线观看| 麻豆国产一区二区| 欧美精品在欧美一区二区少妇| 亚洲精品乱码久久久久| 97精品久久久久中文字幕| 欧美激情中文字幕| 久久99精品久久久久婷婷| 91精品国产色综合久久| 亚洲成人黄色小说| 欧美日韩电影在线| 亚洲一区二区三区自拍| 91久久线看在观草草青青| 亚洲欧洲色图综合| 99久久综合国产精品| 国产精品久久久久久久久免费相片 | 香蕉成人啪国产精品视频综合网| 一本一本久久a久久精品综合麻豆| 日本一区二区三区四区 | 日本高清无吗v一区| 亚洲精品乱码久久久久久久久| 91免费国产视频网站| 亚洲欧美另类小说视频| 色8久久人人97超碰香蕉987| 亚洲综合一区二区| 欧美日韩一级大片网址| 亚洲成人在线免费| 欧美一区二区三区精品| 久久精品国产精品亚洲红杏| 久久精品在这里| 99国产精品久久久久久久久久久| 日韩综合一区二区| 日韩欧美的一区| 丁香婷婷综合色啪| 亚洲精品成a人| 91精品国产综合久久久蜜臀图片| 日韩成人免费电影| 亚洲国产精品成人综合| 色婷婷精品久久二区二区蜜臀av | 天天综合色天天综合| 欧美成人一区二区三区片免费| 国产精品自拍三区| 亚洲卡通欧美制服中文| 91精品国产色综合久久ai换脸| 国产成人综合在线观看| 亚洲欧洲av一区二区三区久久| 欧美日韩中字一区| 韩国视频一区二区| 亚洲制服丝袜一区| 欧美激情在线观看视频免费| 在线视频观看一区| 国内外成人在线| 亚洲欧美色综合| 欧美成va人片在线观看| 成人黄色片在线观看| 亚洲不卡一区二区三区| 中文字幕av不卡| 欧美一区二区三区视频免费| 成人激情文学综合网| 久久精品噜噜噜成人av农村| 亚洲六月丁香色婷婷综合久久| 欧美精品一区二区三区蜜臀| 色综合天天综合在线视频| 久久99精品久久久久久动态图| 一区二区三区免费网站| 国产日本亚洲高清| 日韩视频中午一区| 欧美亚洲国产一区在线观看网站| 国产一区在线看| 婷婷亚洲久悠悠色悠在线播放 | 欧美三级韩国三级日本三斤| 国产98色在线|日韩| 久久国产视频网| 日韩成人免费看| 亚洲一区在线视频| 日韩美女啊v在线免费观看| 久久综合色8888| 日韩一级欧美一级| 欧美日韩精品一区二区三区四区| 99re8在线精品视频免费播放| 韩国成人福利片在线播放| 秋霞电影一区二区| 日韩精彩视频在线观看| 亚洲国产成人av好男人在线观看| 亚洲视频一二区| ...中文天堂在线一区| 中文字幕精品一区二区精品绿巨人| 日韩精品一区国产麻豆| 欧美一区二区三区免费视频 | 久久久久久麻豆| 欧美成人精精品一区二区频| 91精品国产全国免费观看 | 国产精品亚洲综合一区在线观看| 日韩精品成人一区二区三区| 午夜精品一区二区三区免费视频| 夜色激情一区二区| 亚洲成a人v欧美综合天堂下载 | 日韩精品国产精品| 日韩国产欧美在线播放| 日韩精品福利网| 裸体歌舞表演一区二区| 国产麻豆午夜三级精品| 国产成人无遮挡在线视频| 国产不卡视频一区二区三区| 成人app软件下载大全免费| 丁香另类激情小说| 99re热视频精品| 欧美日韩精品一区二区三区四区 | 国产成人av网站| 国产99久久久国产精品免费看| 波多野结衣精品在线| 欧美性xxxxxxxx| 欧美sm极限捆绑bd| 国产精品二区一区二区aⅴ污介绍| 成人欧美一区二区三区1314| 亚洲综合色自拍一区| 日产欧产美韩系列久久99| 国产一区二区在线观看免费| 99视频一区二区| 91精品国产欧美一区二区| 国产亚洲婷婷免费| 亚洲永久精品大片| 看国产成人h片视频| 成人午夜精品一区二区三区| 欧美日韩在线播放一区| 精品久久国产老人久久综合| 亚洲男人天堂av网| 狠狠色丁香婷综合久久| 91亚洲精华国产精华精华液| 制服丝袜亚洲精品中文字幕| 欧美国产日韩亚洲一区| 午夜国产精品一区| www.欧美亚洲| 日韩欧美高清dvd碟片| 亚洲美女淫视频| 国产精品一区二区x88av| 欧美天天综合网| 中文字幕精品一区| 麻豆国产精品视频| 欧美日韩在线精品一区二区三区激情| 欧美不卡视频一区| 香蕉乱码成人久久天堂爱免费| 成人h精品动漫一区二区三区| 日韩一区二区麻豆国产|