Guest User

Untitled

a guest
Jun 20th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. Message ID:
  2. Could not synchronize database state with session org.hibernate.exception.LockAcquisitionException
  3.  
  4. Complete Message:
  5. Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:105) at
  6. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at
  7. org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at
  8. org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114) at
  9. org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109) at
  10. org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244) at
  11. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2382) at
  12. org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335) at
  13. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635) at
  14. org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115) at
  15. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at
  16. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at
  17. org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at
  18. org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at
  19. org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64) at
  20. org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996) at
  21. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141) at
  22. org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at
  23. org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67) at
  24. net.xxx.server.dao.impl.PaymentDAOImpl.listPaymentsByStateAndCompany(PaymentDAOImpl.java:270)
  25.  
  26. private static final String QUERY_FOR_PAYMENTS_BY_STATE_AND_COMPANY = " FROM " + Payment.class.getName()
  27. + " p WHERE p.serviceDefinition.company=:company"
  28. + " AND p.state = :state";
  29.  
  30. @SuppressWarnings("unchecked")
  31. public List<Payment> listPaymentsByStateAndCompany(Company company,Constants.PaymentState state) {
  32. List<Payment> payments = this.getEntityManager()
  33. .createQuery(QUERY_FOR_PAYMENTS_BY_STATE_AND_COMPANY)
  34. .setParameter("state",state.ordinal())
  35. .setParameter("company",company)
  36. .getResultList();
  37. return payments;
  38. }
  39.  
  40. ------------------------
  41. LATEST DETECTED DEADLOCK
  42. ------------------------
  43. 090428 12:21:11
  44. *** (1) TRANSACTION:
  45. TRANSACTION 0 14286818, ACTIVE 0 sec, process no 21872, OS thread id 802850 starting index read
  46. mysql tables in use 1, locked 1
  47. LOCK WAIT 13 lock struct(s), heap size 1024, undo log entries 2
  48. MySQL thread id 298, query id 11843357 localhost 127.0.0.1 root Updating
  49. /* */ update service set balance=40.0, company_id=2, last_on='2009-04-28 12:19:55', modified_by='server', modified_on='2009-04-28 12:21:11', service_definition_id=3, state=1, subscriber_id=13578, valid_until='2010-02-22 12:13:52' where service_id=693
  50. *** (1) WAITING FOR THIS LOCK TO BE GRANTED:
  51. RECORD LOCKS space id 0 page no 62 n bits 176 index `PRIMARY` of table `xxx/service` trx id 0 14286818 lock_mode X locks rec but not gap waiting
  52. Record lock, heap no 98 PHYSICAL RECORD: n_fields 12; compact format; info bits 0
  53. 0: len 8; hex 80000000000002b5; asc ;; 1: len 6; hex 000000d9faa0; asc ;; 2: len 7; hex 0000000cc91e70; asc p;; 3: len 4; hex 00001c42; asc B;; 4: len 8; hex 80001245aad4e363; asc E c;; 5: len 6; hex 736572766572; asc server;; 6: len 8; hex 80001245aad4e3c9; asc E ;; 7: len 1; hex 81; asc ;; 8: len 8; hex 80001247f200df08; asc G ;; 9: len 8; hex 8000000000000002; asc ;; 10: len 8; hex 8000000000000003; asc ;; 11: len 8; hex 800000000000350a; asc 5 ;;
  54.  
  55. *** (2) TRANSACTION:
  56. TRANSACTION 0 14286798, ACTIVE 1 sec, process no 24963, OS thread id 393239 starting index read, thread declared inside InnoDB 500
  57. mysql tables in use 1, locked 1
  58. 17 lock struct(s), heap size 1024, undo log entries 16
  59. MySQL thread id 253, query id 11843359 localhost 127.0.0.1 root Updating
  60. /* */ update payment set credit=1.0, currency='EUR', modified_by='9999900092', modified_on='2009-04-28 12:21:11', payment_definition_id=7, price=1.0, service_definition_id=3, state=0, subscriber_id=13578, transaction_id=11463 where payment_id=15914
  61. *** (2) HOLDS THE LOCK(S):
  62. RECORD LOCKS space id 0 page no 62 n bits 176 index `PRIMARY` of table `xxx/service` trx id 0 14286798 lock mode S locks rec but not gap
  63. Record lock, heap no 47 PHYSICAL RECORD: n_fields 12; compact format; info bits 0
  64. 0: len 8; hex 8000000000000286; asc ;; 1: len 6; hex 000000d9ffce; asc ;; 2: len 7; hex 0000000cc90683; asc ;; 3: len 4; hex 0000f841; asc A;; 4: len 8; hex 80001245aad4e3b2; asc E ;; 5: len 6; hex 736572766572; asc server;; 6: len 8; hex 80001245aad4e3ff; asc E ;; 7: len 1; hex 81; asc ;; 8: len 8; hex 80001245d450fed8; asc E P ;; 9: len 8; hex 8000000000000002; asc ;; 10: len 8; hex 8000000000000003; asc ;; 11: len 8; hex 80000000000034db; asc 4 ;;
  65.  
  66. mysql> SELECT @@global.tx_isolation;
  67. +-----------------------+
  68. | @@global.tx_isolation |
  69. +-----------------------+
  70. | READ-UNCOMMITTED |
  71. +-----------------------+
  72. 1 row in set (0.00 sec)
  73.  
  74. mysql> SELECT @@tx_isolation;
  75. +------------------+
  76. | @@tx_isolation |
  77. +------------------+
  78. | READ-UNCOMMITTED |
  79. +------------------+
  80. 1 row in set (0.00 sec)
  81.  
  82. CREATE TABLE locktest (a INT(11), b INT(11), PRIMARY KEY (a)) ENGINE=INNODB;
  83. INSERT INTO locktest VALUE (1, 1);
  84. INSERT INTO locktest VALUE (2, 1);
  85.  
  86. C1> BEGIN;
  87. C2> BEGIN;
  88. C1> UPDATE locktest SET b = b + 1 WHERE a = 1;
  89. C2> UPDATE locktest SET b = b + 1 WHERE a = 2;
  90. C1> UPDATE locktest SET b = b + 1 WHERE a = 2;
  91. C2> UPDATE locktest SET b = b + 1 WHERE a = 1;
Add Comment
Please, Sign In to add comment