Программисты JAVA общаются здесь
Anonymous
Получение ПРЕДУПРЕЖДЕНИЯ: Ошибка SQL: 1205, SQLState: 41000 ОШИБКА: превышено время ожидания блокировки; попробуйте пере
Сообщение
Anonymous » 17 окт 2025, 16:19
Я новичок в разработке веб-приложений на Java и пытаюсь сохранить запись с помощью спящего режима в базе данных MySQL, но получаю сообщение об ошибке при попытке сохранить запись.
Класс POJO
Код: Выделить всё
package defaultpackage;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
public class Sirs implements java.io.Serializable {
private int sirsid;
private String sirsDescription;
private String submitter;
public Sirs() {
}
public Sirs(int sirsid) {
this.sirsid = sirsid;
}
public Sirs(int sirsid, String sirsDescription, String submitter) {
this.sirsid = sirsid;
this.sirsDescription = sirsDescription;
this.submitter = submitter;
}
@GeneratedValue(strategy=GenerationType.TABLE)
public int getSirsid() {
return this.sirsid;
}
public void setSirsid(int sirsid) {
this.sirsid = sirsid;
}
public String getSirsDescription() {
return this.sirsDescription;
}
public void setSirsDescription(String sirsDescription) {
this.sirsDescription = sirsDescription;
}
public String getSubmitter() {
return this.submitter;
}
public void setSubmitter(String submitter) {
this.submitter = submitter;
}
}
Файл sirs.hbm.xml
Hibernate.cfg.xml
Код: Выделить всё
org.hibernate.dialect.MySQLDialect
com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/sirsdb?
zeroDateTimeBehavior=convertToNull
root
root
true
update
код addsirs.jsp
файл web.xml
Код: Выделить всё
contextConfigLocation
/WEB-INF/applicationContext.xml
org.springframework.web.context.ContextLoaderListener
dispatcher
org.springframework.web.servlet.DispatcherServlet
1
dispatcher
*.htm
30
redirect.jsp
Окно сервера Glassfish
Код: Выделить всё
Info: Hibernate: insert into sirsdb.sirs (`SIRS Description`, Submitter, SIRSID) values (?, ?,
?)
WARN: SQL Error: 1205, SQLState: 41000
ERROR: Lock wait timeout exceeded; try restarting transaction
Info: HHH000010: On release of batch it still contained JDBC statements
Info: e=could not execute statement
Пожалуйста, помогите!!
Подробнее здесь:
https://stackoverflow.com/questions/275 ... t-exceeded
1760707165
Anonymous
Я новичок в разработке веб-приложений на Java и пытаюсь сохранить запись с помощью спящего режима в базе данных MySQL, но получаю сообщение об ошибке при попытке сохранить запись. Класс POJO [code]package defaultpackage; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; public class Sirs implements java.io.Serializable { private int sirsid; private String sirsDescription; private String submitter; public Sirs() { } public Sirs(int sirsid) { this.sirsid = sirsid; } public Sirs(int sirsid, String sirsDescription, String submitter) { this.sirsid = sirsid; this.sirsDescription = sirsDescription; this.submitter = submitter; } @GeneratedValue(strategy=GenerationType.TABLE) public int getSirsid() { return this.sirsid; } public void setSirsid(int sirsid) { this.sirsid = sirsid; } public String getSirsDescription() { return this.sirsDescription; } public void setSirsDescription(String sirsDescription) { this.sirsDescription = sirsDescription; } public String getSubmitter() { return this.submitter; } public void setSubmitter(String submitter) { this.submitter = submitter; } } [/code] Файл sirs.hbm.xml [code] [/code] Hibernate.cfg.xml [code] org.hibernate.dialect.MySQLDialect com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/sirsdb? zeroDateTimeBehavior=convertToNull root root true update [/code] код addsirs.jsp [code] SIRS ID Description Submitter [/code] файл web.xml [code] contextConfigLocation /WEB-INF/applicationContext.xml org.springframework.web.context.ContextLoaderListener dispatcher org.springframework.web.servlet.DispatcherServlet 1 dispatcher *.htm 30 redirect.jsp [/code] Окно сервера Glassfish [code]Info: Hibernate: insert into sirsdb.sirs (`SIRS Description`, Submitter, SIRSID) values (?, ?, ?) WARN: SQL Error: 1205, SQLState: 41000 ERROR: Lock wait timeout exceeded; try restarting transaction Info: HHH000010: On release of batch it still contained JDBC statements Info: e=could not execute statement [/code] Пожалуйста, помогите!! Подробнее здесь: [url]https://stackoverflow.com/questions/27564411/getting-warn-sql-error-1205-sqlstate-41000-error-lock-wait-timeout-exceeded[/url]