title: With EclipseLink, send a statement to the database on each new connection
body: <p>I'm using EclipseLink to access an SQLite database. SQLite, by default, because of backwards compatibility, does not enforce foreign key constraints. Foreign keys constraints can be enabled on per-connection basis using <code>connection.createStatement().execute("PRAGMA foreign_keys=ON")</code>.</p>
  
  <p>When using JDBC, the following code does the trick:</p>
  
  <pre><code>Connection connection = DriverManager.getConnection("jdbc:sqlite:example.db");
  Statement statement = connection.createStatement();
  statement.execute("PRAGMA foreign_keys=ON");
  // From now on, foreign key constraints are enforced on 'connection'
  </code></pre>
  
  <p>How would I get the same effect with JPA/EclipseLink?</p>