我使用jpa(eclipse链接)当我测试我的类main以将数据添加到我的表时我得到此错误
[EL Info]: 2014-07-18 22:41:55.274--ServerSession(22745079)--EclipseLink, version: Eclipse Persistence Services - 2.4.2.v20130514-5956486 [EL Info]: connection: 2014-07-18 22:41:55.637--ServerSession(22745079)--
file:/C:/Users/toshiba/workspaceV2/login/build/classes/_login login successful
Exception in thread "main" java.lang.IllegalStateException: Exception Description: No transaction is currently active
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:77)
at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
at dao.Comptesdao.ajouterComptedao(Comptesdao.java:17)
at test.Main.main(Main.java:15)
你知道吗