Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended EntityManager and EntityManagerFactory with Autoclosable #176

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/javax/persistence/EntityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*
* @since Java Persistence 1.0
*/
public interface EntityManager {
public interface EntityManager extends AutoCloseable {

/**
* Make an instance managed and persistent.
Expand Down Expand Up @@ -808,6 +808,7 @@ public StoredProcedureQuery createStoredProcedureQuery(
* @throws IllegalStateException if the entity manager
* is container-managed
*/
@Override
public void close();

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/javax/persistence/EntityManagerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @since Java Persistence 1.0
*/
public interface EntityManagerFactory {
public interface EntityManagerFactory extends AutoCloseable {

/**
* Create a new application-managed <code>EntityManager</code>.
Expand Down Expand Up @@ -130,6 +130,7 @@ public interface EntityManagerFactory {
* @throws IllegalStateException if the entity manager factory
* has been closed
*/
@Override
public void close();

/**
Expand Down