title: Spring transaction management and OSGi
body: <p>I'm new to OSGi and I have an application that I would like to migrate to OSGi.</p>
  
  <p>I've created one bundle that only consists of DAO interfaces. This bundle represents my DAO services.
  I've also created a second bundle that provides implementations of the DAO interfaces using JDBC. This bundle registers one service per interface using Apache Felix Dependency Manager. This way, my services are accessible from other components.</p>
  
  <p>My DAO implementation classes were annotated with the <code>@Repository</code> annotation for automatic classpath scanning, but now I use the OSGi service registry for service registration. Therefore, the services may be obtained by client code directly using Apache Felix Dependency Manager.</p>
  
  <p>The methods of my DAO implementation classes are also annotated with the <code>@Transactional</code> annotation for transaction management. The issue is that the <code>@Transactional</code> annotations will not have any effect since the DAOs are not registered in any Spring container.</p>
  
  <p>What is the right way for handling transactions when using OSGi? I don't want to use Spring programmatic transaction management.</p>
  
  <p>Thanks,
  Mickael</p>