Advertisement
Guest User

Untitled

a guest
Mar 8th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. spring.data.jpa.repositories.enabled=true
  2. spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  3. spring.datasource.url=jdbc:mysql://localhost/project_db?user=root&password=root
  4. spring.jpa.generate-ddl=true
  5. spring.jpa.hibernate.ddl-auto=update
  6. spring.jpa.show-sql = true
  7. spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  8.  
  9. public enum Roles implements Serializable {
  10. ROLE_USER,
  11. ROLE_ADMIN
  12. }
  13.  
  14. @Id
  15. @GeneratedValue(strategy = GenerationType.IDENTITY)
  16. @Column(name = "id")
  17. private Long Id;
  18. @Basic
  19. @Column(name = "username")
  20. private String username;
  21. @Basic
  22. @Column(name = "password")
  23. private String password;
  24. @Basic
  25. @Column(name = "fullname")
  26. private String fullName;
  27. @ElementCollection(targetClass = Roles.class, fetch = FetchType.EAGER)
  28. @Enumerated(EnumType.STRING)
  29. @JoinTable(name = "user_roles", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id"))
  30. private Set<Roles> roles;
  31.  
  32. Hibernate: insert into users (fullname, password, username) values (?, ?, ?)
  33. Hibernate: insert into user_roles (user_id, roles) values (?, ?)
  34.  
  35. `javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not prepare statement
  36. Caused by: org.hibernate.exception.GenericJDBCException: could not prepare statementce.PersistenceException:
  37. Caused by: java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
  38. com.mysql.jdbc.jdbc2.optional.MysqlXAException: No operations allowed after connection closed.
  39. java.sql.SQLException: ConnectionImple.registerDatabase - ARJUNA017017: enlist of resource failed
  40.  
  41. com.mysql.jdbc.jdbc2.optional.MysqlXAException: No operations allowed after connection closed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement