Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- Throw an exception dosnt cause to rollback when it is n

- Throw an exception dosnt cause to rollback when it is n

2007-06-13       - By avihaimar

 Back
I have a facade (Stateless) and a DAO (stateless)

@(protected)
@(protected)(HotelService.class)
@(protected)(HotelService.class)
public class HotelServiceBean implements HotelService {


   @(protected)
   private HotelDao hotelDao;

   public List findAllHotels() {
       return hotelDao.findAllHotels();
   }

   public Hotel saveHotel(Hotel newHotel) {
      Hotel hotel =  hotelDao.saveHotel(newHotel);
      String test = null;
      if(test == null){
         throw new RuntimeException();
      }
       return hotel;
   }

}


As you can see after the dao save the record i throw an exception , but the
record was save to the DB and roll back was not executed.

DS:

<?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?>

<!-- $Id: mysql-ds.xml 41016 2006-02-07 14:23:00Z acoliver $ -->
<!--  Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->


<local-tx-datasource>    
   <jndi-name>TestDS</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
   <driver-class>com.mysql.jdbc.Driver Source code of com.mysql.jdbc.Driver</driver-class>
   <user-name>test</user-name>
   1234
   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor
.MySQLExceptionSorter</exception-sorter-class-name>
   <!-- should only be used on drivers after 3.22.1 with "ping" support
   <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor
.MySQLValidConnectionChecker</valid-connection-checker-class-name>
   -->
   <!-- sql to call when connection is created
   <new-connection-sql>some arbitrary sql</new-connection-sql>
     -->
   <!-- sql to call on an existing pooled connection when it is obtained from
pool - MySQLValidConnectionChecker is preferred for newer drivers
   <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
     -->

   <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
-->
   
      <type-mapping>mySQL</type-mapping>
   
</local-tx-datasource>    



Perssistence.xml


 <persistence-unit name="Demo">
   <jta-data-source>java:/TestDS</jta-data-source>
   
     
   
 </persistence-unit>




Thank you very much!!!!!!


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4054073#4054073

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4054073
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.