File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Jpa/mysql issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Jpa/mysql issue" Watch "Jpa/mysql issue" New topic
Author

Jpa/mysql issue

Martin Sp
Greenhorn

Joined: Mar 15, 2012
Posts: 2
Hi guys,

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:


[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 => [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 => [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)


E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 761
    
    9
Try using instead of
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jpa/mysql issue
 
Similar Threads
call a stored procedure using eclipselink Problem...
Spring/JPA/TopLink 11g extensions
JPA EclipseLink SEQUENCE table does not exist
How to ignore / merge duplicates in OneToMany when using multiple emf (ProJPA2)
Problem using EclipseLink -> org.springframework.dao.InvalidDataAccessApiUsageException