0 Replies Latest reply on Jun 13, 2007 1:18 PM by Avihai Marchiano

    Throw an exception dosnt cause to rollback when it is not in

    Avihai Marchiano Novice

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

      public class HotelServiceBean implements HotelService {

      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.


      <?xml version="1.0" encoding="UTF-8"?>

      <!-- $Id: mysql-ds.xml 41016 2006-02-07 14:23:00Z acoliver $ -->
      <!-- Datasource config for MySQL using 3.0.9 available from:

      <!-- should only be used on drivers after 3.22.1 with "ping" support
      <!-- 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) -->




      <persistence-unit name="Demo">


      Thank you very much!!!!!!