Author: dgeraskov
Date: 2011-11-21 12:58:25 -0500 (Mon, 21 Nov 2011)
New Revision: 36509
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
Removed:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-3.2.0.Final.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.0.Beta7.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.0.GA.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.0.0.Beta5.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jta-1.1.jar
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Alpha.jar
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
Log:
Move to Hibernate4.0.0.CR6
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-11-21
17:21:57 UTC (rev 36508)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/.classpath 2011-11-21
17:58:25 UTC (rev 36509)
@@ -1,24 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib"
path="lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/slf4j-api-1.5.8.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/antlr-2.7.7.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/classmate-0.5.4.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/commons-collections-3.1.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/commons-collections-3.2.1.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/required/dom4j-1.6.1.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/hibernate-commons-annotations-3.2.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/hibernate-commons-annotations-4.0.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/hibernate-core-4.0.0.CR6.jar"
sourcepath="/home/eskimo/Downloads/hibernate-release-4.0.0.CR6/project"/>
<classpathentry exported="true" kind="lib"
path="lib/required/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/jandex-1.0.0.Beta7.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/javassist-3.12.0.GA.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/jboss-logging-3.0.0.Beta5.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/jta-1.1.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/required/slf4j-api-1.5.8.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/jandex-1.0.3.Final.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/javassist-3.12.1.GA.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/jboss-logging-3.1.0.CR1.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/tools/freemarker.jar"/>
- <classpathentry exported="true" kind="lib"
path="lib/tools/hibernate-tools-3.5.0.Alpha.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/tools/hibernate-tools-3.5.0.Beta.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/tools/jtidy-r8-20060801.jar"/>
<classpathentry exported="true" kind="lib"
path="lib/bsh-core-2.0b4.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/log4j-1.2.15.jar"/>
+ <classpathentry exported="true" kind="lib"
path="lib/slf4j-log4j12-1.5.8.jar"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="lib"
path="lib/required/hibernate-core-4.0.0.CR1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF 2011-11-21
17:21:57 UTC (rev 36508)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/META-INF/MANIFEST.MF 2011-11-21
17:58:25 UTC (rev 36509)
@@ -16,23 +16,24 @@
org.eclipse.jdt.core;bundle-version="3.7.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: lib/required/hibernate-core-4.0.0.CR1.jar,
- lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar,
+Bundle-ClassPath: lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar,
lib/required/antlr-2.7.7.jar,
lib/required/classmate-0.5.4.jar,
- lib/required/commons-collections-3.1.jar,
+ lib/required/commons-collections-3.2.1.jar,
lib/required/dom4j-1.6.1.jar,
- lib/required/hibernate-commons-annotations-3.2.0.Final.jar,
+ lib/required/hibernate-commons-annotations-4.0.0.Final.jar,
+ lib/required/hibernate-core-4.0.0.CR6.jar,
lib/required/hibernate-jpa-2.0-api-1.0.1.Final.jar,
- lib/required/jandex-1.0.0.Beta7.jar,
- lib/required/javassist-3.12.0.GA.jar,
- lib/required/jboss-logging-3.0.0.Beta5.jar,
- lib/required/jta-1.1.jar,
- lib/required/slf4j-api-1.5.8.jar,
+ lib/required/jandex-1.0.3.Final.jar,
+ lib/required/javassist-3.12.1.GA.jar,
+ lib/required/jboss-logging-3.1.0.CR1.jar,
+ lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar,
lib/tools/freemarker.jar,
lib/tools/hibernate-tools-3.5.0.Alpha.jar,
+ lib/tools/hibernate-tools-3.5.0.Beta.jar,
lib/tools/jtidy-r8-20060801.jar,
lib/bsh-core-2.0b4.jar,
+ lib/required/slf4j-api-1.5.8.jar,
lib/log4j-1.2.15.jar,
lib/slf4j-log4j12-1.5.8.jar,
.
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties 2011-11-21
17:21:57 UTC (rev 36508)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/build.properties 2011-11-21
17:58:25 UTC (rev 36509)
@@ -7,4 +7,5 @@
lib/bsh-core-2.0b4.jar,\
lib/jpa/,\
lib/required/,\
- lib/tools/
+ lib/tools/,\
+ lib/required/slf4j-api-1.5.8.jar
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR1.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/jpa/hibernate-entitymanager-4.0.0.CR6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.1.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/commons-collections-3.2.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-3.2.0.Final.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-commons-annotations-4.0.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR1.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/hibernate-core-4.0.0.CR6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.0.Beta7.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jandex-1.0.3.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.0.GA.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/javassist-3.12.1.GA.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.0.0.Beta5.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-logging-3.1.0.CR1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/required/jta-1.1.jar
===================================================================
(Binary files differ)
Deleted:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Alpha.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/lib/tools/hibernate-tools-3.5.0.Beta.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java 2011-11-21
17:21:57 UTC (rev 36508)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/ConfigurationFactory.java 2011-11-21
17:58:25 UTC (rev 36509)
@@ -68,7 +68,7 @@
public class ConfigurationFactory {
- public static final String FAKE_TM_LOOKUP =
"org.hibernate.console.FakeTransactionManagerLookup"; //$NON-NLS-1$
+ public static final String FAKE_TM_LOOKUP =
"org.jboss.tools.hibernate4_0.FakeTransactionManagerLookup"; //$NON-NLS-1$
private ConsoleConfigurationPreferences prefs;
private Map<String, FakeDelegatingDriver> fakeDrivers;
Added:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
(rev 0)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java 2011-11-21
17:58:25 UTC (rev 36509)
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate4_0;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+
+import org.hibernate.HibernateException;
+import org.hibernate.service.ServiceRegistry;
+import org.hibernate.service.ServiceRegistryBuilder;
+import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
+import org.hibernate.transaction.TransactionManagerLookup;
+
+public class FakeTransactionManagerLookup implements TransactionManagerLookup {
+
+ public TransactionManager getTransactionManager(Properties props)
+ throws HibernateException {
+ if ( FakeTransactionManager.INSTANCE == null ) {
+ FakeTransactionManager.INSTANCE = new FakeTransactionManager(props);
+ }
+ return FakeTransactionManager.INSTANCE;
+ }
+
+ public String getUserTransactionName() {
+ return null; //throw new UnsupportedOperationException();
+ }
+
+ public Object getTransactionIdentifier(Transaction transaction) {
+ return transaction;
+ }
+
+}
+
+class FakeTransactionManager implements TransactionManager {
+
+ public static FakeTransactionManager INSTANCE;
+
+ private FakeTransaction current;
+ ConnectionProvider connections;
+
+ public FakeTransactionManager(Properties props) {
+ ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
+ ServiceRegistry buildServiceRegistry =
builder.applySettings(props).buildServiceRegistry();
+ connections = buildServiceRegistry.getService(ConnectionProvider.class);
+ }
+
+ public void begin() throws NotSupportedException, SystemException {
+ current = new FakeTransaction(this);
+ current.begin();
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+ if(current!=null) current.commit();
+ }
+
+
+ public int getStatus() throws SystemException {
+ if(current!=null) {
+ return current.getStatus();
+ } else {
+ return Status.STATUS_NO_TRANSACTION;
+ }
+ }
+
+ public Transaction getTransaction() throws SystemException {
+ return current;
+ }
+
+ public void resume(Transaction tx) throws InvalidTransactionException,
+ IllegalStateException, SystemException {
+ current = (FakeTransaction) tx;
+ }
+
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException {
+ if(current!=null) current.rollback();
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ if(current!=null) current.setRollbackOnly();
+ }
+
+ public void setTransactionTimeout(int t) throws SystemException {
+ }
+
+ public Transaction suspend() throws SystemException {
+ Transaction result = current;
+ current = null;
+ return result;
+ }
+
+ public FakeTransaction getCurrent() {
+ return current;
+ }
+
+ void endCurrent(FakeTransaction tx) {
+ if (current==tx) current=null;
+ }
+
+}
+
+class FakeTransaction implements Transaction {
+
+ int status;
+ private Connection connection;
+ List<Synchronization> synchronizations = new ArrayList<Synchronization>();
+ private FakeTransactionManager transactionManager;
+
+ FakeTransaction(FakeTransactionManager transactionManager) {
+ status = Status.STATUS_NO_TRANSACTION;
+ this.transactionManager = transactionManager;
+ }
+
+ public void begin() throws SystemException {
+ try {
+ connection = transactionManager.connections.getConnection();
+ }
+ catch (SQLException sqle) {
+
+ sqle.printStackTrace();
+ throw new SystemException(sqle.toString());
+ }
+ status = Status.STATUS_ACTIVE;
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+
+ if (status == Status.STATUS_MARKED_ROLLBACK) {
+ rollback();
+ }
+ else {
+ status = Status.STATUS_PREPARING;
+
+ for (Synchronization s : synchronizations) {
+ s.beforeCompletion();
+ }
+
+ status = Status.STATUS_COMMITTING;
+
+ try {
+ connection.commit();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ status = Status.STATUS_COMMITTED;
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ }
+
+ public boolean delistResource(XAResource arg0, int arg1)
+ throws IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean enlistResource(XAResource arg0) throws RollbackException,
+ IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public int getStatus() throws SystemException {
+ return status;
+ }
+
+ public void registerSynchronization(Synchronization sync)
+ throws RollbackException, IllegalStateException, SystemException {
+ synchronizations.add(sync);
+ }
+
+ public void rollback() throws IllegalStateException, SystemException {
+
+ status = Status.STATUS_ROLLING_BACK;
+
+// Synch.beforeCompletion() should *not* be called for rollbacks
+// for ( int i=0; i<synchronizations.size(); i++ ) {
+// Synchronization s = (Synchronization) synchronizations.get(i);
+// s.beforeCompletion();
+// }
+
+ status = Status.STATUS_ROLLEDBACK;
+
+ try {
+ connection.rollback();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ status = Status.STATUS_MARKED_ROLLBACK;
+ }
+
+ void setConnection(Connection connection) {
+ this.connection = connection;
+ }
+
+ public Connection getConnection() {
+ return connection;
+ }
+}
Property changes on:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/FakeTransactionManagerLookup.java
___________________________________________________________________
Added: svn:executable
+ *
Modified:
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
===================================================================
---
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-11-21
17:21:57 UTC (rev 36508)
+++
branches/hibernatetools-multiversion2/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2011-11-21
17:58:25 UTC (rev 36509)
@@ -35,9 +35,9 @@
import org.hibernate.console.ext.QueryResultImpl;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.console.preferences.PreferencesClassPathUtils;
-import org.hibernate.service.BasicServiceRegistry;
+import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
-import org.hibernate.service.internal.BasicServiceRegistryImpl;
+import org.hibernate.service.internal.StandardServiceRegistryImpl;
/**
*
@@ -56,7 +56,7 @@
private SessionFactory sessionFactory;
- private BasicServiceRegistry serviceRegistry;
+ private ServiceRegistry serviceRegistry;
private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String,
FakeDelegatingDriver>();
@@ -151,7 +151,7 @@
if (sessionFactory != null) {
sessionFactory.close();
sessionFactory = null;
- ( (BasicServiceRegistryImpl) serviceRegistry ).destroy();
+ ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
serviceRegistry = null;
res = true;
}