package org.csc.phynixx.spring.integration.atomikos; /* * #%L * phynixx-spring * %% * Copyright (C) 2014 - 2015 Christoph Schmidt-Casdorff * %% * 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. * #L% */ /** * Created by Christoph Schmidt-Casdorff on 27.08.14. * * @see http://stackoverflow.com/questions/20681245/how-to-use-atomikos-transaction-essentials-with-hibernate-4-3 */ import com.atomikos.icatch.jta.UserTransactionManager; import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform; import javax.transaction.TransactionManager; import javax.transaction.UserTransaction; /** * see http://stackoverflow.com/questions/20681245/how-to-use-atomikos-transaction-essentials-with-hibernate-4-3 */ public class AtomikosJtaPlatform extends AbstractJtaPlatform { private static final long serialVersionUID = 1L; private UserTransactionManager utm; public AtomikosJtaPlatform() { utm = new UserTransactionManager(); } @Override protected TransactionManager locateTransactionManager() { return utm; } @Override protected UserTransaction locateUserTransaction() { return utm; } }