cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r569726 - in /cayenne/sandbox/cayenne-jpa-tutorial: ./ lib/ sql/ src/ src/META-INF/ src/cayenne/ src/cayenne/jpa/ src/cayenne/jpa/tutorial/
Date Sat, 25 Aug 2007 20:04:47 GMT
Author: aadamchik
Date: Sat Aug 25 13:04:46 2007
New Revision: 569726

URL: http://svn.apache.org/viewvc?rev=569726&view=rev
Log:
Initial check in of a simple command line tutorial for JPA

Added:
    cayenne/sandbox/cayenne-jpa-tutorial/.classpath
    cayenne/sandbox/cayenne-jpa-tutorial/.project
    cayenne/sandbox/cayenne-jpa-tutorial/README.txt   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/
    cayenne/sandbox/cayenne-jpa-tutorial/lib/ashwood-1.1.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-2.2.3.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-commons-2.2.3.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-agent-3.0-SNAPSHOT.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-server-3.0-SNAPSHOT.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-collections-3.1.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-lang-2.1.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-logging-1.1.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/derby-10.3.1.4.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/geronimo-jpa_3.0_spec-1.0.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/lib/velocity-1.3.jar   (with props)
    cayenne/sandbox/cayenne-jpa-tutorial/sql/
    cayenne/sandbox/cayenne-jpa-tutorial/sql/derbydb.sql
    cayenne/sandbox/cayenne-jpa-tutorial/src/
    cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/
    cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/persistence.xml
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Artist.java
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Gallery.java
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Main.java
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Painting.java
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial.java

Added: cayenne/sandbox/cayenne-jpa-tutorial/.classpath
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/.classpath?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/.classpath (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/.classpath Sat Aug 25 13:04:46 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="lib/geronimo-jpa_3.0_spec-1.0.jar"/>
+	<classpathentry sourcepath="/Users/andrus/work/cayenne/framework/cayenne-server/target/cayenne-server-3.0-SNAPSHOT-sources.jar"
kind="lib" path="lib/cayenne-server-3.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/velocity-1.3.jar"/>
+	<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
+	<classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
+	<classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
+	<classpathentry kind="lib" path="lib/ashwood-1.1.jar"/>
+	<classpathentry kind="lib" path="lib/asm-commons-2.2.3.jar"/>
+	<classpathentry kind="lib" path="lib/asm-2.2.3.jar"/>
+	<classpathentry kind="lib" path="lib/derby-10.3.1.4.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: cayenne/sandbox/cayenne-jpa-tutorial/.project
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/.project?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/.project (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/.project Sat Aug 25 13:04:46 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>cayenne-jpa-tutorial</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: cayenne/sandbox/cayenne-jpa-tutorial/README.txt
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/README.txt?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/README.txt (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/README.txt Sat Aug 25 13:04:46 2007
@@ -0,0 +1,25 @@
+RUNNING THE TUTORIAL:
+
+1. Get needed jars 
+(note that tutorial project includes them already, so the list below is given for the reference)
+
+* cayenne-server.jar
+* cayenne-agent.jar
+* derby.jar (v. 10.2.2.0 or newer is required; example is built against 10.3.1.4)
+* jpa.jar (e.g. Geronimo JPA jar from here: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/geronimo/specs/geronimo-jpa_3.0_spec/1.0/geronimo-jpa_3.0_spec-1.0.jar)
+* asm.jar
+* asm-commons.jar
+* all Cayenne distro "third-party/" jars
+
+2. Set desired Derby DB location in "persistence.xml" and "sql/derbydb.sql" files.
+
+3. Create test Derby database, use Derby "ij" client tool (again, the example is tested on
Derby 10.3.1.4):
+
+$ export DERBY_HOME=[path to derby]
+$ export PATH=$DERBY_HOME/bin:$PATH
+$ ij cayenne-jpa-tutorial/sql/derbydb.sql
+
+4. Run the tutorial from Eclipse. In the "Arguments" tab of the "Run" panel set the following
VM argument 
+(edit for the proper agent jar location):
+
+-javaagent:/path/to/cayenne-jpa-tutorial/lib/cayenne-agent-3.0-SNAPSHOT.jar
\ No newline at end of file

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/ashwood-1.1.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/ashwood-1.1.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/ashwood-1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-2.2.3.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-2.2.3.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-2.2.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-commons-2.2.3.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-commons-2.2.3.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/asm-commons-2.2.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-agent-3.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-agent-3.0-SNAPSHOT.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-agent-3.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-server-3.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-server-3.0-SNAPSHOT.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/cayenne-server-3.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-collections-3.1.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-collections-3.1.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-collections-3.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-lang-2.1.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-lang-2.1.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-lang-2.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-logging-1.1.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-logging-1.1.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/commons-logging-1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/derby-10.3.1.4.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/derby-10.3.1.4.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/derby-10.3.1.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/geronimo-jpa_3.0_spec-1.0.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/geronimo-jpa_3.0_spec-1.0.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/geronimo-jpa_3.0_spec-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/lib/velocity-1.3.jar
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/lib/velocity-1.3.jar?rev=569726&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/sandbox/cayenne-jpa-tutorial/lib/velocity-1.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/sandbox/cayenne-jpa-tutorial/sql/derbydb.sql
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/sql/derbydb.sql?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/sql/derbydb.sql (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/sql/derbydb.sql Sat Aug 25 13:04:46 2007
@@ -0,0 +1,16 @@
+-- Must match the DB file location specified in 'persistence.xml',
+-- as 'org.apache.cayenne.datasource.jdbc.url' property.
+CONNECT 'jdbc:derby:/Users/andrus/Desktop/testdb;create=true';
+
+CREATE TABLE GALLERY (ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID));
+CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY
KEY (ID));
+CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, ID INTEGER NOT NULL, NAME VARCHAR
(200), PRIMARY KEY (ID));
+
+ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID);
+ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID);
+
+CREATE TABLE AUTO_PK_SUPPORT (TABLE_NAME CHAR(100) NOT NULL,  NEXT_ID INTEGER NOT NULL, 
PRIMARY KEY(TABLE_NAME));
+INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('Artist', 200);
+INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('Gallery', 200);
+INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('Painting', 200);
+

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/persistence.xml?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/persistence.xml (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/META-INF/persistence.xml Sat Aug 25 13:04:46
2007
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence>
+	<persistence-unit name="cayenne-tutorial">
+		<description>Cayenne JPA Tutorial</description>
+		<non-jta-data-source>local-data-source</non-jta-data-source>
+		<class>cayenne.jpa.tutorial.Artist</class>
+		<class>cayenne.jpa.tutorial.Gallery</class>
+		<class>cayenne.jpa.tutorial.Painting</class>
+		<properties>
+			<property name="org.apache.cayenne.datasource.jdbc.driver"
+				value="org.apache.derby.jdbc.EmbeddedDriver" />
+			<property name="org.apache.cayenne.datasource.jdbc.url"
+				value="jdbc:derby:/Users/andrus/Desktop/testdb;create=true" />
+			<!--  
+			<property name="org.apache.cayenne.datasource.jdbc.username" value="test" />
+			<property name="org.apache.cayenne.datasource.jdbc.password" value="secret" />
+			-->
+		</properties>
+	</persistence-unit>
+</persistence>

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Artist.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Artist.java?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Artist.java (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Artist.java Sat Aug 25 13:04:46
2007
@@ -0,0 +1,63 @@
+package cayenne.jpa.tutorial;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Artist {
+
+	static final String DEFAULT_DATE_FORMAT = "yyyyMMdd";
+
+	@Id
+	protected int id;
+
+	protected String name;
+
+	// demonstration of how default column name can be overriden
+	@Column(name = "DATE_OF_BIRTH")
+	protected Date dateOfBirth;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String artistName) {
+		this.name = artistName;
+	}
+
+	public Date getDateOfBirth() {
+		return dateOfBirth;
+	}
+
+	public void setDateOfBirth(Date dateOfBirth) {
+		this.dateOfBirth = dateOfBirth;
+	}
+
+	/**
+	 * Sets date of birth using a string in format yyyyMMdd.
+	 */
+	public void setDateOfBirthString(String yearMonthDay) {
+		if (yearMonthDay == null) {
+			setDateOfBirth(null);
+		} else {
+
+			Date date;
+			try {
+				date = new SimpleDateFormat(DEFAULT_DATE_FORMAT)
+						.parse(yearMonthDay);
+			} catch (ParseException e) {
+				throw new IllegalArgumentException(
+						"A date argument must be in format '"
+								+ DEFAULT_DATE_FORMAT + "': " + yearMonthDay);
+			}
+
+			setDateOfBirth(date);
+		}
+	}
+
+}

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Gallery.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Gallery.java?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Gallery.java (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Gallery.java Sat Aug 25
13:04:46 2007
@@ -0,0 +1,21 @@
+package cayenne.jpa.tutorial;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Gallery {
+
+	@Id
+	protected int id;
+
+	protected String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Main.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Main.java?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Main.java (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Main.java Sat Aug 25 13:04:46
2007
@@ -0,0 +1,27 @@
+package cayenne.jpa.tutorial;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+
+public class Main {
+	public static void main(String[] args) {
+
+		// create entity manager
+
+		// due to the current enhancer limitations, separate all work with
+		// entities in a separate Tutorial class, so that the Entity classes are
+		// loaded only after the provider is initialized
+
+		EntityManagerFactory emf = Persistence
+				.createEntityManagerFactory("cayenne-tutorial");
+		EntityManager em = emf.createEntityManager();
+
+		try {
+			new Tutorial(em).execute();
+		} finally {
+			em.close();
+			emf.close();
+		}
+	}
+}

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Painting.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Painting.java?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Painting.java (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Painting.java Sat Aug 25
13:04:46 2007
@@ -0,0 +1,20 @@
+package cayenne.jpa.tutorial;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class Painting {
+	@Id
+	protected int id;
+
+	protected String name;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+}

Added: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial.java?rev=569726&view=auto
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial.java (added)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial.java Sat Aug 25
13:04:46 2007
@@ -0,0 +1,44 @@
+package cayenne.jpa.tutorial;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+
+public class Tutorial {
+
+	protected EntityManager em;
+
+	public Tutorial(EntityManager em) {
+		this.em = em;
+	}
+
+	public void execute() {
+		EntityTransaction tx = null;
+		try {
+			// cleanup using EJBQL queries
+			tx = em.getTransaction();
+			tx.begin();
+			em.createQuery("delete from Painting").executeUpdate();
+			em.createQuery("delete from Gallery").executeUpdate();
+			em.createQuery("delete from Artist").executeUpdate();
+			tx.commit();
+
+			// create new persistent object
+			tx = em.getTransaction();
+			tx.begin();
+
+			Artist picasso = new Artist();
+			picasso.setName("Pablo Picasso");
+			picasso.setDateOfBirthString("18811025");
+
+			em.persist(picasso);
+			tx.commit();
+
+		} catch (Throwable th) {
+			th.printStackTrace();
+
+			if (tx != null) {
+				tx.rollback();
+			}
+		}
+	}
+}



Mime
View raw message