title: OSGi thread-safety cautions
body: <p>I have heard that using the low-level OSGi API generally can induce some thread-safety problems, like when registering a service implementation (e.g in <a href="https://www.youtube.com/watch?feature=player_detailpage&amp;v=DBjgJpqanh0#t=2178" rel="nofollow noreferrer">this presentation</a>).</p>
  
  <p><strong>Q1</strong>. What kind of problems are those? Could someone show an example?</p>
  
  <p>In particular I want to install a JPA bundle (probably EclipseLink) in an OSGi container (Apache Felix) from within my bundle, where the JPA bundle is jarred with my bundle (see <a href="https://stackoverflow.com/questions/20148375/packing-multiple-osgi-bundles-in-the-same-jar">this question</a> for details). </p>
  
  <p><strong>Q2.</strong> What kind of thread-safety bugs could I have if I simply call <code>BundleContext.installBundle()</code>? If there are any problems, could "Spring DM" help me solve those problems?</p>