when I want to run my spring boot app (with h2 database) I should change my database name every time and if I...
when I want to run my spring boot app (with h2 database) I should change my database name every time and I can't use my previous databases and if I don't change it's name, it gives me this error:
Error starting ApplicationContext. To display the auto-configuration report
re-run your application with 'debug' enabled.
2019-01-01 00:01:28.153 ERROR 2404 --- [ main]
o.s.boot.SpringApplication : Application startup failed
org.springframework.orm.ObjectOptimisticLockingFailureException: Object of
class [guru.springframework.domain.User] with identifier [1]: optimistic
locking failed; nested exception is org.hibernate.StaleObjectStateException:
Row was updated or deleted by another transaction (or unsaved-value mapping
was incorrect) : [guru.springframework.domain.User#1]
my application.property:
spring.profiles.active=springdatajpa
spring.jackson.serialization.write-dates-as-timestamps=false
spring.jpa.show-sql=true
spring.h2.console.enabled=true
spring.datasource.url= jdbc:h2:file:E:/db16
spring.jpa.hibernate.ddl-auto=update
User class:
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class User extends AbstractDomainClass {
private Long userId;
private String username;
private String password;
private String firstName;
private String lastName;
private String email;
private String encryptedPassword;
private Boolean enabled = true;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "user_id"),
// inverseJoinColumns = @joinColumn(name = "role_id"))
private List<Role> roles = new ArrayList<>();
private Integer failedLoginAttempts = 0;
public User() {
}
public User(Long userId, String username, String firstName, String lastName,
boolean enabled, String email, String encrytedPassword) {
super();
this.userId = userId;
this.username = username;
this.firstName = firstName;
this.lastName = lastName;
this.enabled = enabled;
this.email = email;
this.encryptedPassword = encrytedPassword;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEncryptedPassword() {
return encryptedPassword;
}
public void setEncryptedPassword(String encryptedPassword) {
this.encryptedPassword = encryptedPassword;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public void addRole(Role role){
if(!this.roles.contains(role)){
this.roles.add(role);
}
if(!role.getUsers().contains(this)){
role.getUsers().add(this);
}
}
public void removeRole(Role role){
this.roles.remove(role);
role.getUsers().remove(this);
}
public Integer getFailedLoginAttempts() {
return failedLoginAttempts;
}
public void setFailedLoginAttempts(Integer failedLoginAttempts) {
this.failedLoginAttempts = failedLoginAttempts;
}
}
Role class:
import guru.springframework.domain.AbstractDomainClass;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Role extends AbstractDomainClass {
private String role;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "role_id"),
// inverseJoinColumns = @joinColumn(name = "user_id"))
private List<User> users = new ArrayList<>();
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public void addUser(User user){
if(!this.users.contains(user)){
this.users.add(user);
}
if(!user.getRoles().contains(this)){
user.getRoles().add(this);
}
}
public void removeUser(User user){
this.users.remove(user);
user.getRoles().remove(this);
}
}
AbstractDomain class:
import javax.persistence.*;
import java.util.Date;
@MappedSuperclass
public class AbstractDomainClass implements DomainObject {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer id;
@Version
private Integer version;
private Date dateCreated;
private Date lastUpdated;
@Override
public Integer getId() {
return this.id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getDateCreated() {
return dateCreated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@PreUpdate
@PrePersist
public void updateTimeStamps() {
lastUpdated = new Date();
if (dateCreated==null) {
dateCreated = new Date();
}
}
}
Thanks for your answer!
This StackoverFlow tells me to add some more details, so I put this sentence and I don't know what else I should add for details!
java spring hibernate spring-boot h2
add a comment |
when I want to run my spring boot app (with h2 database) I should change my database name every time and I can't use my previous databases and if I don't change it's name, it gives me this error:
Error starting ApplicationContext. To display the auto-configuration report
re-run your application with 'debug' enabled.
2019-01-01 00:01:28.153 ERROR 2404 --- [ main]
o.s.boot.SpringApplication : Application startup failed
org.springframework.orm.ObjectOptimisticLockingFailureException: Object of
class [guru.springframework.domain.User] with identifier [1]: optimistic
locking failed; nested exception is org.hibernate.StaleObjectStateException:
Row was updated or deleted by another transaction (or unsaved-value mapping
was incorrect) : [guru.springframework.domain.User#1]
my application.property:
spring.profiles.active=springdatajpa
spring.jackson.serialization.write-dates-as-timestamps=false
spring.jpa.show-sql=true
spring.h2.console.enabled=true
spring.datasource.url= jdbc:h2:file:E:/db16
spring.jpa.hibernate.ddl-auto=update
User class:
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class User extends AbstractDomainClass {
private Long userId;
private String username;
private String password;
private String firstName;
private String lastName;
private String email;
private String encryptedPassword;
private Boolean enabled = true;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "user_id"),
// inverseJoinColumns = @joinColumn(name = "role_id"))
private List<Role> roles = new ArrayList<>();
private Integer failedLoginAttempts = 0;
public User() {
}
public User(Long userId, String username, String firstName, String lastName,
boolean enabled, String email, String encrytedPassword) {
super();
this.userId = userId;
this.username = username;
this.firstName = firstName;
this.lastName = lastName;
this.enabled = enabled;
this.email = email;
this.encryptedPassword = encrytedPassword;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEncryptedPassword() {
return encryptedPassword;
}
public void setEncryptedPassword(String encryptedPassword) {
this.encryptedPassword = encryptedPassword;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public void addRole(Role role){
if(!this.roles.contains(role)){
this.roles.add(role);
}
if(!role.getUsers().contains(this)){
role.getUsers().add(this);
}
}
public void removeRole(Role role){
this.roles.remove(role);
role.getUsers().remove(this);
}
public Integer getFailedLoginAttempts() {
return failedLoginAttempts;
}
public void setFailedLoginAttempts(Integer failedLoginAttempts) {
this.failedLoginAttempts = failedLoginAttempts;
}
}
Role class:
import guru.springframework.domain.AbstractDomainClass;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Role extends AbstractDomainClass {
private String role;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "role_id"),
// inverseJoinColumns = @joinColumn(name = "user_id"))
private List<User> users = new ArrayList<>();
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public void addUser(User user){
if(!this.users.contains(user)){
this.users.add(user);
}
if(!user.getRoles().contains(this)){
user.getRoles().add(this);
}
}
public void removeUser(User user){
this.users.remove(user);
user.getRoles().remove(this);
}
}
AbstractDomain class:
import javax.persistence.*;
import java.util.Date;
@MappedSuperclass
public class AbstractDomainClass implements DomainObject {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer id;
@Version
private Integer version;
private Date dateCreated;
private Date lastUpdated;
@Override
public Integer getId() {
return this.id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getDateCreated() {
return dateCreated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@PreUpdate
@PrePersist
public void updateTimeStamps() {
lastUpdated = new Date();
if (dateCreated==null) {
dateCreated = new Date();
}
}
}
Thanks for your answer!
This StackoverFlow tells me to add some more details, so I put this sentence and I don't know what else I should add for details!
java spring hibernate spring-boot h2
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18
add a comment |
when I want to run my spring boot app (with h2 database) I should change my database name every time and I can't use my previous databases and if I don't change it's name, it gives me this error:
Error starting ApplicationContext. To display the auto-configuration report
re-run your application with 'debug' enabled.
2019-01-01 00:01:28.153 ERROR 2404 --- [ main]
o.s.boot.SpringApplication : Application startup failed
org.springframework.orm.ObjectOptimisticLockingFailureException: Object of
class [guru.springframework.domain.User] with identifier [1]: optimistic
locking failed; nested exception is org.hibernate.StaleObjectStateException:
Row was updated or deleted by another transaction (or unsaved-value mapping
was incorrect) : [guru.springframework.domain.User#1]
my application.property:
spring.profiles.active=springdatajpa
spring.jackson.serialization.write-dates-as-timestamps=false
spring.jpa.show-sql=true
spring.h2.console.enabled=true
spring.datasource.url= jdbc:h2:file:E:/db16
spring.jpa.hibernate.ddl-auto=update
User class:
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class User extends AbstractDomainClass {
private Long userId;
private String username;
private String password;
private String firstName;
private String lastName;
private String email;
private String encryptedPassword;
private Boolean enabled = true;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "user_id"),
// inverseJoinColumns = @joinColumn(name = "role_id"))
private List<Role> roles = new ArrayList<>();
private Integer failedLoginAttempts = 0;
public User() {
}
public User(Long userId, String username, String firstName, String lastName,
boolean enabled, String email, String encrytedPassword) {
super();
this.userId = userId;
this.username = username;
this.firstName = firstName;
this.lastName = lastName;
this.enabled = enabled;
this.email = email;
this.encryptedPassword = encrytedPassword;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEncryptedPassword() {
return encryptedPassword;
}
public void setEncryptedPassword(String encryptedPassword) {
this.encryptedPassword = encryptedPassword;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public void addRole(Role role){
if(!this.roles.contains(role)){
this.roles.add(role);
}
if(!role.getUsers().contains(this)){
role.getUsers().add(this);
}
}
public void removeRole(Role role){
this.roles.remove(role);
role.getUsers().remove(this);
}
public Integer getFailedLoginAttempts() {
return failedLoginAttempts;
}
public void setFailedLoginAttempts(Integer failedLoginAttempts) {
this.failedLoginAttempts = failedLoginAttempts;
}
}
Role class:
import guru.springframework.domain.AbstractDomainClass;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Role extends AbstractDomainClass {
private String role;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "role_id"),
// inverseJoinColumns = @joinColumn(name = "user_id"))
private List<User> users = new ArrayList<>();
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public void addUser(User user){
if(!this.users.contains(user)){
this.users.add(user);
}
if(!user.getRoles().contains(this)){
user.getRoles().add(this);
}
}
public void removeUser(User user){
this.users.remove(user);
user.getRoles().remove(this);
}
}
AbstractDomain class:
import javax.persistence.*;
import java.util.Date;
@MappedSuperclass
public class AbstractDomainClass implements DomainObject {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer id;
@Version
private Integer version;
private Date dateCreated;
private Date lastUpdated;
@Override
public Integer getId() {
return this.id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getDateCreated() {
return dateCreated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@PreUpdate
@PrePersist
public void updateTimeStamps() {
lastUpdated = new Date();
if (dateCreated==null) {
dateCreated = new Date();
}
}
}
Thanks for your answer!
This StackoverFlow tells me to add some more details, so I put this sentence and I don't know what else I should add for details!
java spring hibernate spring-boot h2
when I want to run my spring boot app (with h2 database) I should change my database name every time and I can't use my previous databases and if I don't change it's name, it gives me this error:
Error starting ApplicationContext. To display the auto-configuration report
re-run your application with 'debug' enabled.
2019-01-01 00:01:28.153 ERROR 2404 --- [ main]
o.s.boot.SpringApplication : Application startup failed
org.springframework.orm.ObjectOptimisticLockingFailureException: Object of
class [guru.springframework.domain.User] with identifier [1]: optimistic
locking failed; nested exception is org.hibernate.StaleObjectStateException:
Row was updated or deleted by another transaction (or unsaved-value mapping
was incorrect) : [guru.springframework.domain.User#1]
my application.property:
spring.profiles.active=springdatajpa
spring.jackson.serialization.write-dates-as-timestamps=false
spring.jpa.show-sql=true
spring.h2.console.enabled=true
spring.datasource.url= jdbc:h2:file:E:/db16
spring.jpa.hibernate.ddl-auto=update
User class:
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class User extends AbstractDomainClass {
private Long userId;
private String username;
private String password;
private String firstName;
private String lastName;
private String email;
private String encryptedPassword;
private Boolean enabled = true;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "user_id"),
// inverseJoinColumns = @joinColumn(name = "role_id"))
private List<Role> roles = new ArrayList<>();
private Integer failedLoginAttempts = 0;
public User() {
}
public User(Long userId, String username, String firstName, String lastName,
boolean enabled, String email, String encrytedPassword) {
super();
this.userId = userId;
this.username = username;
this.firstName = firstName;
this.lastName = lastName;
this.enabled = enabled;
this.email = email;
this.encryptedPassword = encrytedPassword;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEncryptedPassword() {
return encryptedPassword;
}
public void setEncryptedPassword(String encryptedPassword) {
this.encryptedPassword = encryptedPassword;
}
public Boolean getEnabled() {
return enabled;
}
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
public List<Role> getRoles() {
return roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public void addRole(Role role){
if(!this.roles.contains(role)){
this.roles.add(role);
}
if(!role.getUsers().contains(this)){
role.getUsers().add(this);
}
}
public void removeRole(Role role){
this.roles.remove(role);
role.getUsers().remove(this);
}
public Integer getFailedLoginAttempts() {
return failedLoginAttempts;
}
public void setFailedLoginAttempts(Integer failedLoginAttempts) {
this.failedLoginAttempts = failedLoginAttempts;
}
}
Role class:
import guru.springframework.domain.AbstractDomainClass;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Role extends AbstractDomainClass {
private String role;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable
// ~ defaults to @JoinTable(name = "USER_ROLE", joinColumns = @JoinColumn(name = "role_id"),
// inverseJoinColumns = @joinColumn(name = "user_id"))
private List<User> users = new ArrayList<>();
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public void addUser(User user){
if(!this.users.contains(user)){
this.users.add(user);
}
if(!user.getRoles().contains(this)){
user.getRoles().add(this);
}
}
public void removeUser(User user){
this.users.remove(user);
user.getRoles().remove(this);
}
}
AbstractDomain class:
import javax.persistence.*;
import java.util.Date;
@MappedSuperclass
public class AbstractDomainClass implements DomainObject {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Integer id;
@Version
private Integer version;
private Date dateCreated;
private Date lastUpdated;
@Override
public Integer getId() {
return this.id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Date getDateCreated() {
return dateCreated;
}
public Date getLastUpdated() {
return lastUpdated;
}
@PreUpdate
@PrePersist
public void updateTimeStamps() {
lastUpdated = new Date();
if (dateCreated==null) {
dateCreated = new Date();
}
}
}
Thanks for your answer!
This StackoverFlow tells me to add some more details, so I put this sentence and I don't know what else I should add for details!
java spring hibernate spring-boot h2
java spring hibernate spring-boot h2
edited Dec 31 '18 at 21:11
Azamnia
asked Dec 31 '18 at 20:51
AzamniaAzamnia
144
144
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18
add a comment |
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53991322%2fwhen-i-want-to-run-my-spring-boot-app-with-h2-database-i-should-change-my-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53991322%2fwhen-i-want-to-run-my-spring-boot-app-with-h2-database-i-should-change-my-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you post Role entity and AbstractDomainClass?
– Jonathan Johx
Dec 31 '18 at 21:02
Can you please post your CODE of the database transaction? I mean where/how you add to database.
– Damith
Jan 1 at 10:18