title: JPA/MySql issue
body: <p>I am building JPA based application using mysql and ecliselink.I have very strange issue when try to insert stuff into my database.I am able to insert data into single table but when it comes to one-to-may and vice versa something goes wrong.Currently I have 2 main and 1 reference table(it holds the foreign keys of the other two tables).It is strange because I dont have "sequence" in my database table When I try to insert data into any of my tables I get this exception: </p>
  
  <pre><code>[EL Info]: 2012-03-15 17:52:28.64--ServerSession(18621340)--EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461 
  [EL Info]: 2012-03-15 17:52:29.23--ServerSession(18621340)--file:/D:/git-eclipse/Martin/reference/build/classes/_reference login successful 
  [EL Warning]: 2012-03-15 17:52:29.389--ClientSession(31843177)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException 
  Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eclipse1.sequence' doesn't exist 
  Error Code: 1146 
  Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ? 
  bind =&gt; [2 parameters bound] 
  Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?") 
  
  Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eclipse1.sequence' doesn't exist 
  Error Code: 1146 
  Call: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ? 
  bind =&gt; [2 parameters bound] 
  Query: DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?") 
  [EL Info]: 2012-03-15 17:52:29.394--ServerSession(18621340)--file:/D:/git-eclipse/Martin/reference/build/classes/_reference logout successful 
  Exception in thread "main" java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager. 
  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.verifyOpen(EntityManagerImpl.java:1665) 
  at org.eclipse.persistence.internal.jpa.EntityManagerImpl.close(EntityManagerImpl.java:1529) 
  at OneToManyRelation.main(OneToManyRelation.java:47) 
  </code></pre>
  
  <p>I am posting one class only because others are quite similar</p>
  
  <pre><code>@Entity
  
      @Table(name="category")
  
      public class Category {
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      @Column(name="CategoryID")
      private int CategoryID;
  
  /**
  * @return the id
  */
  public int getId() {
  return CategoryID;
  }
  
  /**
  * @param id the id to set
  */
  public void setId(int CategoryID) {
  this.CategoryID = CategoryID;
  }
  
  @Column(name="category", nullable=false, length=50, insertable=true)
  private String category;
  
  /**
  * @return the category
  */
  public String getCategory() {
  return category;
  }
  
  
  public void setCategory(String category) {
  this.category = category;
  }
  
  @OneToMany(cascade=CascadeType.ALL)
  @JoinTable(name = "templateemail", joinColumns = {
  @JoinColumn(name="categoryId", unique = true) 
  },
  inverseJoinColumns = {
  @JoinColumn(name="templateId")
  }
  )
  private Set&lt;Template&gt; template;
  
  /**
  * 
  */
  public Set&lt;Template&gt; getChildren() {
  return template;
  }
  
  /**
  * 
  */
  public void setChildren(Set&lt;Template&gt; template) {
  this.template = template;
  }
  
  }
  </code></pre>
  
  <p>Do you have any idea what is wrong with my code?</p>
  
  <p>Thanks in advance</p>