I have a playback structure with a simple model Address, but when I call the ebean #save () method, I get the following errors.
The database is set up correctly. I think (I can read models without problems). My unit tests that work in the H2 database work fine.
the code:
Address address = new Address(street, postalcode, location);
address.save();
Play output:
[error] c.j.b.ConnectionHandle - Database access problem. Killing off this connection and all remaining connections in the connection pool. SQL State = HY000
[error] play - Cannot invoke the action, eventually got an error: javax.persistence.PersistenceException: java.sql.SQLException: Connection is closed!
Class address
@Entity
public class Address extends Model {
@Id
public int id;
public String postalcode;
public String street;
public String location;
@OneToMany(cascade= CascadeType.ALL)
public List<Estate> estates;
public Address(String street, String postalcode, String location){
this.postalcode = postalcode;
this.street = street;
this.location = location;
}
public Address(int id, String street, String postalcode, String location){
this.id = id;
this.postalcode = postalcode;
this.street = street;
this.location = location;
}
public static Finder<Integer,Address> find = new Finder<Integer, Address>(
Integer.class, Address.class
);
}
source
share