If anyone is following this (?) I've managed to squeeze a commit out my DAOImpl 
by changing the code to this...







   public void openMyTransaction()

   {

      System.out.println("***************  Opening 
it.  *****************");

      session = super.getSession();

      xaction = session.beginTransaction();

   }

   

   public void closeMyTransaction()

   {

      System.out.println("***************  Closing 
it.  *****************");

      xaction.commit();

      session.flush();

   }







   ... followed by ...





      persDao.openMyTransaction();

      

      person = (Person) 
persDao.create("Matilda", "Marketmaker");

      

      persDao.closeMyTransaction();





So that eliminates the last question in my previous post.  I'm committing a 
different transaction, from the one with the insert.



    ¿How can I get a handle on the DAO's transaction?



Well I do understand that the whole thing is being handled by Spring AOP.  I 
was hoping to side step that but I no longer think it's feasable.



I have to figure out how to get this stuff from the applicationContext.xml into 
my tests, correct ....





&nbsp; &nbsp; <!-- Service Transactional Interceptor -->

&nbsp; &nbsp; <bean id="serviceTransactionInterceptor" 
class="org.springframework.transaction.interceptor.TransactionInterceptor">

&nbsp; &nbsp; &nbsp; &nbsp; <property name="transactionManager"><ref 
bean="transactionManager"/></property>

&nbsp; &nbsp; &nbsp; &nbsp; <property name="transactionAttributeSource">

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <value>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
net.justtrade.realworld.business_layer.ActorManager.createActor=PROPAGATION_REQUIRED

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
net.justtrade.realworld.business_layer.ActorManager.createPerson=PROPAGATION_REQUIRED

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </value>

&nbsp; &nbsp; &nbsp; &nbsp; </property>

&nbsp; &nbsp; </bean>



&nbsp; &nbsp; <!-- ActorManager Service Implementation&nbsp; -->

&nbsp; &nbsp; <bean id="actorManagerTarget" 
class="net.justtrade.realworld.business_layer.ActorManagerImpl">

&nbsp; &nbsp; </bean>



&nbsp; &nbsp; <!-- ActorManager Service Proxy&nbsp; -->

&nbsp; &nbsp; <bean id="actorManager" 
class="org.springframework.aop.framework.ProxyFactoryBean">

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<property name="target"><ref 
bean="actorManagerTarget"/></property>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<property name="proxyInterfaces">

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;<value>net.justtrade.realworld.business_layer.ActorManager</value>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</property>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<property name="interceptorNames">

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<list>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;<value>serviceTransactionInterceptor</value>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp;<value>hibernateInterceptor</value>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</list>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</property>

&nbsp; &nbsp; &nbsp;</bean>




--
Regards,

Hasan
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=3460#3460
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to