1 26 27 package org.objectweb.openccm.pss.runtime.hibernate.lib; 28 29 30 38 39 public abstract class CatalogBase 40 extends org.objectweb.openccm.pss.runtime.common.lib.CatalogBase 41 implements org.objectweb.openccm.pss.runtime.hibernate.api.CatalogBase 42 { 43 49 52 private net.sf.hibernate.Session _hibernate_session; 53 54 60 66 public CatalogBase(int id, net.sf.hibernate.Session session) 67 { 68 super(id); 69 _hibernate_session = session; 70 } 71 72 78 84 90 96 102 107 public net.sf.hibernate.Session 108 get_hibernate_session() 109 { 110 return _hibernate_session; 111 } 112 113 116 public void 117 begin_tx() 118 { 119 try { 120 get_hibernate_session().beginTransaction(); 121 } catch (net.sf.hibernate.HibernateException ex) { 122 throw new RuntimeException (ex); 123 } 124 } 125 126 129 public void 130 commit_tx() 131 { 132 try { 133 net.sf.hibernate.Transaction t = get_hibernate_session().beginTransaction(); 134 t.commit(); 135 } catch (net.sf.hibernate.HibernateException ex) { 136 throw new RuntimeException (ex); 137 } 138 } 139 140 143 public void 144 rollback_tx() 145 { 146 try { 147 net.sf.hibernate.Transaction t = get_hibernate_session().beginTransaction(); 148 t.rollback(); 149 } catch (net.sf.hibernate.HibernateException ex) { 150 throw new RuntimeException (ex); 151 } 152 } 153 } 154 | Popular Tags |