---
title: "Deadlock found when trying to get lock; try restarting transaction"
author: "submaze"
date: "2015-12-02T20:13:54Z"
tags: []
categories: ["编程语言"]
slug: "deadlock-found-when-trying-to-get-lock-try-restarting-transaction"
draft: false
lastmod: "2015-12-02T20:13:54Z"
id: 2261203
url: "https://submaze.iteye.com/blog/2261203"
---

批量插入数据遇到异常
this.getJdbcTemplate().batchUpdate(insertSynUserInfoSql, 
				new BatchPreparedStatementSetter()；

com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction