title: Deadlock when using Spring transaction
body: <p>I have the following classes and methods as below:</p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  import org.springframework.transaction.annotation.Transactional;
  
  @Component
  @Transactional("emp")
  public class EmployeeService {
  
  }
  
  @Component
  public class HumanResourceManager {
  
  [...]
  
  @Autowired
  private EmployeeService employeeService;
  
  @Transactional("emp")
  public void checkEmployee(Employee emp) {
  
  [..]
  
  employeeService.saveEmployee(emp);
  
  [...]
  
  }
  
  My Spring config:
  
  &lt;bean id="employeeDataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="${employee.driverClassName}" /&gt;
          &lt;property name="url" value="${employee.url}" /&gt;
          &lt;property name="username" value="${employee.user}" /&gt;
          &lt;property name="password" value="${employee.password}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="employeeSessionFactory"
          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="employeeDataSource" /&gt;
          &lt;property name="packagesToScan" value="com.xyz.employee.model" /&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${employee.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.internal.NoCacheProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.show.sql"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="employeeTransactionManager"
          class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="employeeSessionFactory" /&gt;
          &lt;qualifier value="emp" /&gt;
      &lt;/bean&gt;
  
      &lt;tx:annotation-driven transaction-manager="employeeTransactionManager" /&gt;
  </code></pre>
  
  <p>I got exception <code>org.hibernate.exception.LockAcquisitionException: ORA-00060: deadlock detected while waiting for resource</code>! and in exception stacktrace this error happened at method <code>checkEmployee</code>.<br>
  Why is this error happenning when the default Propagation of Transaction is REQUIRED? Can anyone explain this?</p>