Java Code Examples for org.springframework.transaction.PlatformTransactionManager

The following are top voted examples for showing how to use org.springframework.transaction.PlatformTransactionManager. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: EasyTransaction   File: ParentTrxStatusUpdateFilter.java   Source Code and License 6 votes vote down vote up
@Override
public EasyTransResult invoke(EasyTransFilterChain filterChain, Map<String, Object> header,
		EasyTransRequest<?, ?> request) {

	Integer pTrxStatus = MetaDataFilter.getMetaData(EasytransConstant.CallHeadKeys.PARENT_TRANSACTION_STATUS);
	if(!pTrxStatus.equals(com.yiqiniu.easytrans.datasource.TransStatusLogger.TransactionStatus.UNKNOWN)){
		// start transaction to update 
		PlatformTransactionManager transactionManager = getTransactionManager(filterChain, request);
		TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager,
				new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRED));
		TransactionId pTrxId = MetaDataFilter.getMetaData(EasytransConstant.CallHeadKeys.PARENT_TRX_ID_KEY);
		transactionTemplate.execute(new TransactionCallback<Object>() {
			@Override
			public Object doInTransaction(TransactionStatus status) {
				TransactionId trxId = pTrxId;
				transStatusLogger.updateExecuteFlagForSlaveTrx(trxId, request, pTrxStatus);
				return null;
			}
		});
		boolean commited = pTrxStatus.equals(com.yiqiniu.easytrans.datasource.TransStatusLogger.TransactionStatus.COMMITTED);
		//may be concurrent,but it's ok
		easyTransSynchronizer.cascadeExecuteCachedTransaction(pTrxId, commited);
	}
	
	return filterChain.invokeFilterChain(header, request);
}
 
Example 2
Project: atsea-sample-shop-app   File: JpaConfiguration.java   Source Code and License 6 votes vote down vote up
@Bean
@Autowired
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
	JpaTransactionManager txManager = new JpaTransactionManager();
	txManager.setEntityManagerFactory(emf);
	return txManager;
}
 
Example 3
Project: bekit   File: FlowTxParser.java   Source Code and License 6 votes vote down vote up
/**
 * 解析流程事务
 *
 * @param flowTx             流程事务
 * @param transactionManager 事务管理器
 * @return 流程事务执行器
 */
public static FlowTxExecutor parseFlowTx(Object flowTx, PlatformTransactionManager transactionManager) {
    // 获取目标class(应对AOP代理情况)
    Class<?> flowTxClass = AopUtils.getTargetClass(flowTx);
    logger.debug("解析流程事务:{}", ClassUtils.getQualifiedName(flowTxClass));
    FlowTx flowTxAnnotation = flowTxClass.getAnnotation(FlowTx.class);
    // 创建流程事务执行器
    FlowTxExecutor flowTxExecutor = new FlowTxExecutor(flowTxAnnotation.flow(), flowTx, transactionManager);
    for (Method method : flowTxClass.getDeclaredMethods()) {
        for (Class clazz : FlowTxExecutor.FLOW_TX_OPERATE_ANNOTATIONS) {
            if (method.isAnnotationPresent(clazz)) {
                // 设置流程事务操作执行器
                flowTxExecutor.setOperateExecutor(clazz, parseFlowTxOperate(method));
                break;
            }
        }
    }
    flowTxExecutor.validate();

    return flowTxExecutor;
}
 
Example 4
Project: composed-task-runner   File: ComposedTaskRunnerStepFactoryTests.java   Source Code and License 6 votes vote down vote up
@Bean
public TaskConfigurer taskConfigurer() {
	return new TaskConfigurer() {
		@Override
		public TaskRepository getTaskRepository() {
			return null;
		}

		@Override
		public PlatformTransactionManager getTransactionManager() {
			return null;
		}

		@Override
		public TaskExplorer getTaskExplorer() {
			return mock(TaskExplorer.class);
		}

		@Override
		public DataSource getTaskDataSource() {
			return mock(DataSource.class);
		}
	};
}
 
Example 5
Project: alfresco-core   File: SpringAwareUserTransaction.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a user transaction that defaults to {@link TransactionDefinition#PROPAGATION_REQUIRED}.
 * 
 * @param transactionManager the transaction manager to use
 * @param readOnly true to force a read-only transaction
 * @param isolationLevel one of the
 *      {@link TransactionDefinition#ISOLATION_DEFAULT TransactionDefinition.ISOLATION_XXX}
 *      constants
 * @param propagationBehaviour one of the
 *      {@link TransactionDefinition#PROPAGATION_MANDATORY TransactionDefinition.PROPAGATION__XXX}
 *      constants
 * @param timeout the transaction timeout in seconds.
 * 
 * @see TransactionDefinition#getTimeout()
 */
public SpringAwareUserTransaction(
        PlatformTransactionManager transactionManager,
        boolean readOnly,
        int isolationLevel,
        int propagationBehaviour,
        int timeout)
{
    super();
    setTransactionManager(transactionManager);
    setTransactionAttributeSource(this);
    this.readOnly = readOnly;
    this.isolationLevel = isolationLevel;
    this.propagationBehaviour = propagationBehaviour;
    this.timeout = timeout;
}
 
Example 6
Project: EasyTransaction   File: TestBusinessDataSourceSelector.java   Source Code and License 5 votes vote down vote up
@Override
public PlatformTransactionManager selectTransactionManager(String appId, String busCode, EasyTransRequest<?, ?> request) {
	if(appId != null){
		busCode = busCode.replace("Cascade", "");
		return ctx.getBean(busCode+"TransactionManager", PlatformTransactionManager.class);
	}else{
		return ctx.getBean("wholeTransactionManager", PlatformTransactionManager.class);
	}
}
 
Example 7
Project: jwala   File: AemJpaConfiguration.java   Source Code and License 5 votes vote down vote up
@Bean
public PlatformTransactionManager getPlatformTransactionManager(final EntityManagerFactory emf) {
    final JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setDefaultTimeout(ApplicationProperties.getAsInteger(JWALA_JTA_TRANSACTION_TIMEOUT, 30));
    transactionManager.setEntityManagerFactory(emf);
    return transactionManager;
}
 
Example 8
Project: bekit   File: ServiceParser.java   Source Code and License 5 votes vote down vote up
/**
 * 解析服务
 *
 * @param service            服务
 * @param transactionManager 事务管理器
 * @return 服务执行器
 */
public static ServiceExecutor parseService(Object service, PlatformTransactionManager transactionManager) {
    // 获取目标class(应对AOP代理情况)
    Class<?> serviceClass = AopUtils.getTargetClass(service);
    logger.debug("解析服务:{}", ClassUtils.getQualifiedName(serviceClass));
    Service serviceAnnotation = serviceClass.getAnnotation(Service.class);
    // 获取服务名称
    String serviceName = serviceAnnotation.name();
    if (StringUtils.isEmpty(serviceName)) {
        serviceName = ClassUtils.getShortNameAsProperty(serviceClass);
    }
    // 创建服务执行器
    ServiceExecutor serviceExecutor = new ServiceExecutor(serviceName, serviceAnnotation.enableTx(), service);
    if (serviceAnnotation.enableTx()) {
        if (transactionManager == null) {
            throw new IllegalArgumentException("服务" + serviceAnnotation.name() + "的enableTx属性为开启状态,但不存在事务管理器(PlatformTransactionManager),请检查是否有配置spring事务管理器");
        }
        serviceExecutor.setTxExecutor(new TxExecutor(transactionManager));
    }
    for (Method method : serviceClass.getDeclaredMethods()) {
        for (Class clazz : ServiceExecutor.SERVICE_PHASE_ANNOTATIONS) {
            if (method.isAnnotationPresent(clazz)) {
                // 设置服务阶段执行器
                serviceExecutor.setPhaseExecutor(clazz, parseServicePhase(method));
                break;
            }
        }
    }
    serviceExecutor.validate();

    return serviceExecutor;
}
 
Example 9
Project: OperatieBRP   File: AbstractBaseReadonlyController.java   Source Code and License 5 votes vote down vote up
/**
 * Zet de transaction manager.
 *
 * @param transactionManager transaction manager
 */
@Inject
public final void setTransactionManagerReadonly(final PlatformTransactionManager transactionManager) {
    final DefaultTransactionDefinition transactionDefinition = new DefaultTransactionDefinition();
    transactionDefinition.setReadOnly(true);
    transactionTemplate = new TransactionTemplate(transactionManager, transactionDefinition);
}
 
Example 10
Project: tipi-engine   File: ActivityRunnerContext.java   Source Code and License 5 votes vote down vote up
public ActivityRunnerContext(ActivityRepository persist, CommandHelperService commandHelperService, CommandService commandService, TopProcessGroupManager groupManager, PlatformTransactionManager txManager, TopProcessGroupLauncher launcher) {
	this.activityRepository = persist;
	this.commandHelperService = commandHelperService;
	this.commandService = commandService;
	this.groupManager = groupManager;
	this.txManager = txManager;
	this.launcher = launcher;
}
 
Example 11
Project: Smart-Shopping   File: JPAConfig.java   Source Code and License 5 votes vote down vote up
@Bean
@Autowired
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) throws NamingException {
	JpaTransactionManager jpaTransaction = new JpaTransactionManager();
	jpaTransaction.setEntityManagerFactory(emf);
	return jpaTransaction;
}
 
Example 12
Project: alfresco-repository   File: TransactionServiceImplTest.java   Source Code and License 5 votes vote down vote up
public void setUp() throws Exception
{
    transactionManager = (PlatformTransactionManager) ctx.getBean("transactionManager");
    transactionService = new TransactionServiceImpl();
    transactionService.setTransactionManager(transactionManager);   
    transactionService.setAllowWrite(true, vetoName);
    
    nodeService = (NodeService) ctx.getBean("dbNodeService");
    authenticationService = (MutableAuthenticationService) ctx.getBean("AuthenticationService");
    personService = (PersonService) ctx.getBean("PersonService");
    
    dialect = (Dialect) ctx.getBean("dialect");
}
 
Example 13
Project: alfresco-repository   File: ExportDbTest.java   Source Code and License 5 votes vote down vote up
@Before
public void setUp() throws Exception
{
    ctx = ApplicationContextHelper.getApplicationContext();
    dataSource = (DataSource) ctx.getBean("dataSource");
    tx = (PlatformTransactionManager) ctx.getBean("transactionManager"); 
    jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    exporter = new ExportDb(ctx);
    exporter.setNamePrefix("export_test_");
    dialect = (Dialect) ctx.getBean("dialect");
}
 
Example 14
Project: lams   File: TransactionAspectSupport.java   Source Code and License 5 votes vote down vote up
/**
 * Prepare a TransactionInfo for the given attribute and status object.
 * @param txAttr the TransactionAttribute (may be {@code null})
 * @param joinpointIdentification the fully qualified method name
 * (used for monitoring and logging purposes)
 * @param status the TransactionStatus for the current transaction
 * @return the prepared TransactionInfo object
 */
protected TransactionInfo prepareTransactionInfo(PlatformTransactionManager tm,
		TransactionAttribute txAttr, String joinpointIdentification, TransactionStatus status) {

	TransactionInfo txInfo = new TransactionInfo(tm, txAttr, joinpointIdentification);
	if (txAttr != null) {
		// We need a transaction for this method
		if (logger.isTraceEnabled()) {
			logger.trace("Getting transaction for [" + txInfo.getJoinpointIdentification() + "]");
		}
		// The transaction manager will flag an error if an incompatible tx already exists
		txInfo.newTransactionStatus(status);
	}
	else {
		// The TransactionInfo.hasTransaction() method will return
		// false. We created it only to preserve the integrity of
		// the ThreadLocal stack maintained in this class.
		if (logger.isTraceEnabled())
			logger.trace("Don't need to create transaction for [" + joinpointIdentification +
					"]: This method isn't transactional.");
	}

	// We always bind the TransactionInfo to the thread, even if we didn't create
	// a new transaction here. This guarantees that the TransactionInfo stack
	// will be managed correctly even if no transaction was created by this aspect.
	txInfo.bindToThread();
	return txInfo;
}
 
Example 15
Project: rjb-blog-multitenancy   File: TransactionConfig.java   Source Code and License 5 votes vote down vote up
@Bean
  public PlatformTransactionManager txManager() throws Exception {
HibernateTransactionManager returnVal = new HibernateTransactionManager(
		hibernateConfig.sessionFactory());
returnVal.setDataSource(dataSourceConfig.dataSource());
return returnVal;
  }
 
Example 16
Project: cas-server-4.2.1   File: JpaLockingStrategyTests.java   Source Code and License 5 votes vote down vote up
@Before
public void setup() {
    final ClassPathXmlApplicationContext ctx = new
        ClassPathXmlApplicationContext("classpath:/jpaSpringContext.xml");
    this.factory = ctx.getBean("ticketEntityManagerFactory", EntityManagerFactory.class);
    this.txManager = ctx.getBean("ticketTransactionManager", PlatformTransactionManager.class);
    this.dataSource = ctx.getBean("dataSourceTicket", DataSource.class);
}
 
Example 17
Project: repository-multi-tenancy   File: DefualtHibernateDataBaseConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(selectAnyDataSource);
}
 
Example 18
Project: holon-datastore-jpa   File: TestJpaDatastoreEclipselink.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
	JpaTransactionManager jtm = new JpaTransactionManager(emf);
	jtm.setDataSource(dataSource());
	return jtm;
}
 
Example 19
Project: springboot_cwenao   File: MybatisConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager platformTransactionManager() {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 20
Project: fo-veilarbjobbsokerkompetanse   File: DataSourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager transactionManager(DataSource ds) throws NamingException {
    return new DataSourceTransactionManager(ds);
}
 
Example 21
Project: EasyTransaction   File: SingleDataSourceSelector.java   Source Code and License 4 votes vote down vote up
public SingleDataSourceSelector(DataSource dataSource, PlatformTransactionManager transactionManager) {
	super();
	this.dataSource = dataSource;
	this.transactionManager = transactionManager;
}
 
Example 22
Project: EasyTransaction   File: SingleDataSourceSelector.java   Source Code and License 4 votes vote down vote up
@Override
public PlatformTransactionManager selectTransactionManager(String appId, String busCode, String trxId) {
	return transactionManager;
}
 
Example 23
Project: EasyTransaction   File: SingleDataSourceSelector.java   Source Code and License 4 votes vote down vote up
@Override
public PlatformTransactionManager selectTransactionManager(String appId, String busCode, EasyTransRequest<?, ?> request) {
	return transactionManager;
}
 
Example 24
Project: holon-datastore-jpa   File: TestDatastoreMultiConditional.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager2(@Qualifier("two") EntityManagerFactory emf) {
	return new JpaTransactionManager(emf);
}
 
Example 25
Project: keti   File: EnvDataSourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
    return this.acsConfigUtil.transactionManager(emf);
}
 
Example 26
Project: springboot-multi-datasource   File: TxConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(AbstractRoutingDataSource dataSource) throws Exception {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 27
Project: Spring-Security-Third-Edition   File: DataSourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean
@Autowired
public PlatformTransactionManager transactionManager(final DataSource dataSource) {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 28
Project: jwala   File: TestJpaConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager getTransactionManager() {
    final PlatformTransactionManager manager = new JpaTransactionManager(getEntityManagerFactory());
    return manager;
}
 
Example 29
Project: spring-boot-starter-quartz   File: QuartzSchedulerAutoConfiguration.java   Source Code and License 4 votes vote down vote up
private PlatformTransactionManager getTransactionManager(ApplicationContext applicationContext) {
	return applicationContext.getBean(PlatformTransactionManager.class);
}
 
Example 30
Project: Purchase-order-process-template   File: Config.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(dataSource());
}
 
Example 31
Project: cmc-claim-store   File: DbConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(TransactionAwareDataSourceProxy dataSource) {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 32
Project: spring-cloud-samples   File: JpaCommonConfig.java   Source Code and License 4 votes vote down vote up
@Bean(name = "commonTransactionManager")
public PlatformTransactionManager transactionManager(LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean) {
	JpaTransactionManager txManager = new JpaTransactionManager();
	txManager.setEntityManagerFactory(localContainerEntityManagerFactoryBean.getObject());
	return txManager;
}
 
Example 33
Project: spring-cloud-samples   File: JpaCommonConfig.java   Source Code and License 4 votes vote down vote up
@Bean(name = "commonTransactionManager")
public PlatformTransactionManager transactionManager(LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean) {
	JpaTransactionManager txManager = new JpaTransactionManager();
	txManager.setEntityManagerFactory(localContainerEntityManagerFactoryBean.getObject());
	return txManager;
}
 
Example 34
Project: dev-courses   File: Config.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory c) {
	JpaTransactionManager txManager = new JpaTransactionManager();
	txManager.setEntityManagerFactory(c);
	return txManager;
}
 
Example 35
Project: springboot-start   File: PrimaryConfig.java   Source Code and License 4 votes vote down vote up
@Primary
@Bean(name = "primaryTransactionManager")
public PlatformTransactionManager primaryTransactionManager(@Qualifier("primaryEntityManager") EntityManagerFactory entityManagerFactory) {
    return new JpaTransactionManager(entityManagerFactory);
}
 
Example 36
Project: holon-datastore-jpa   File: ExampleJpaDatastoreSpring.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
	return new JpaTransactionManager(emf);
}
 
Example 37
Project: amv-access-api-poc   File: JpaConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
    EntityManagerFactory entityManagerFactory = entityManagerFactory().getObject();
    JpaTransactionManager txManager = new JpaTransactionManager(entityManagerFactory);
    return txManager;
}
 
Example 38
Project: holon-datastore-jdbc   File: TestJdbcDatastoreDerby.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
	return new DataSourceTransactionManager(dataSource());
}
 
Example 39
Project: oasp-tutorial-sources   File: BeansBatchConfig.java   Source Code and License 4 votes vote down vote up
/**
 *
 * @param transactionManager the transactionManager to set
 */
@Inject
public void setTransactionManager(PlatformTransactionManager transactionManager) {

  this.transactionManager = transactionManager;
}
 
Example 40
Project: cas-5.1.0   File: CasSupportJdbcAuditConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager inspektrAuditTransactionManager() {
    return new DataSourceTransactionManager(inspektrAuditTrailDataSource());
}
 
Example 41
Project: easy-test   File: MybatisConfig.java   Source Code and License 4 votes vote down vote up
@Bean
@Override
public PlatformTransactionManager annotationDrivenTransactionManager() {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 42
Project: spring-boot-starter-dynamic-datasource   File: TransactionAutoConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 43
Project: springboot-start   File: SecondaryConfig.java   Source Code and License 4 votes vote down vote up
/**
 * @param entityManagerFactory
 * @return
 */
@Bean(name = "secondaryTransactionManager")
public PlatformTransactionManager secondaryTransactionManager(@Qualifier("secondaryEntityManager") EntityManagerFactory entityManagerFactory) {
    return new JpaTransactionManager(entityManagerFactory);
}
 
Example 44
Project: cas-5.1.0   File: CasCoreTicketsConfiguration.java   Source Code and License 4 votes vote down vote up
@ConditionalOnMissingBean(name = "ticketTransactionManager")
@Bean
public PlatformTransactionManager ticketTransactionManager() {
    return new PseudoPlatformTransactionManager();
}
 
Example 45
Project: cas-5.1.0   File: CasCoreTicketsConfiguration.java   Source Code and License 4 votes vote down vote up
@Override
public PlatformTransactionManager annotationDrivenTransactionManager() {
    return ticketTransactionManager();
}
 
Example 46
Project: bekit   File: TxExecutor.java   Source Code and License 4 votes vote down vote up
public TxExecutor(PlatformTransactionManager transactionManager) {
    this.transactionManager = transactionManager;
}
 
Example 47
Project: easynetcn-cloud   File: OneJpaConfig.java   Source Code and License 4 votes vote down vote up
@Primary
@Bean(name = "oneTransactionManager")
public PlatformTransactionManager transactionManagerPrimary(EntityManagerFactoryBuilder builder) {
	return new JpaTransactionManager(entityManagerFactory(builder).getObject());
}
 
Example 48
Project: composed-task-runner   File: ComposedTaskRunnerStepFactoryTests.java   Source Code and License 4 votes vote down vote up
@Bean
public StepBuilderFactory steps(){
	return new StepBuilderFactory(mock(JobRepository.class), mock(PlatformTransactionManager.class));
}
 
Example 49
Project: Spring-Security-Third-Edition   File: DataSourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean
@Autowired
public PlatformTransactionManager transactionManager(final DataSource dataSource) {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 50
Project: spring-boot-oauth2-demo   File: DatasourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean(name = "txManagerTest")
public PlatformTransactionManager txManagerTest() {
    return new DataSourceTransactionManager(dataSourceTest());
}
 
Example 51
Project: lams   File: TransactionTemplate.java   Source Code and License 4 votes vote down vote up
/**
 * Set the transaction management strategy to be used.
 */
public void setTransactionManager(PlatformTransactionManager transactionManager) {
	this.transactionManager = transactionManager;
}
 
Example 52
Project: MicroServiceProject   File: ApplicationConfig.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager(DataSource dataSource) {
    JpaTransactionManager txManager = new JpaTransactionManager();
    txManager.setEntityManagerFactory(entityManagerFactory(dataSource));
    return txManager;
}
 
Example 53
Project: taboola-cronyx   File: CronyxAutoConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean(name = "platformTransactionManager")
public PlatformTransactionManager platformTransactionManager(@Qualifier("cronyxDataSource") DataSource dataSource) {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 54
Project: springboot_op   File: UserDataSourceConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean(name = "transactionManagerUser")
public PlatformTransactionManager transactionManagerUser(EntityManagerFactoryBuilder builder) {
    return new JpaTransactionManager(entityManagerFactoryUser(builder).getObject());
}
 
Example 55
Project: holon-datastore-jdbc   File: TestJdbcDatastoreH2.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
	return new DataSourceTransactionManager(dataSource());
}
 
Example 56
Project: My-Blog   File: CoreApplication.java   Source Code and License 4 votes vote down vote up
@Bean
public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(dataSource());
}
 
Example 57
Project: chimera   File: Open.java   Source Code and License 4 votes vote down vote up
@Autowired
public void setTransactionManager(PlatformTransactionManager tm)
{
    this.tm = tm;
}
 
Example 58
Project: Spring-Security-Third-Edition   File: DataSourceConfig.java   Source Code and License 4 votes vote down vote up
@Bean
@Autowired
public PlatformTransactionManager transactionManager(final DataSource dataSource) {
    return new DataSourceTransactionManager(dataSource);
}
 
Example 59
Project: lemon-dubbo-message   File: MybatisConfiguration.java   Source Code and License 4 votes vote down vote up
@Bean
  public PlatformTransactionManager transactionManager() {
PlatformTransactionManager platformTransactionManager = new DataSourceTransactionManager(dataSource);
      return platformTransactionManager;
  }
 
Example 60
Project: devops-cstack   File: DatabaseConfigurationTest.java   Source Code and License 4 votes vote down vote up
@Bean(name = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
    JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
    jpaTransactionManager.setEntityManagerFactory(entityManagerFactory());
    return jpaTransactionManager;
}