You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by mo...@tecwel.com on 2008/04/29 21:52:41 UTC

InvalidStateException

I get this message when trying to persist an Entity:

Exception in thread "AWT-EventQueue-0" <openjpa-1.0.1-r420667:592145 nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Can only perform operation while a transaction is active.

What does it mean?

--
Morten Bendiksen

The information contained in this message is sent in the strictest confidence for the addressee only.  It is intended only for the use of the addressee and may contain legally privileged information.  If you have received this e-mail in error you are requested to preserve its confidentiality and advise the sender of the error in transmission.
It is the responsibility of the addressee to scan this email and any attachments for computer viruses or other defects.  The sender  does not accept liability for any loss or damage of any nature, however caused, which may result directly or indirectly from this email or any file attached.
All mail from TecWel AS are scanned by both hardware and software antispam and antivirus filters.

RE: InvalidStateException

Posted by C N Davies <cn...@cndavies.com>.
I don't know what is inside "getEntityManager()" but the error suggests to
me that it might be returning a different entity manager instance at each
call, and hence you are committing outside a transaction which is what this
error is telling you.

I would code it like this:

EntityManager em = getEntityManager();
em.getTransaction().begin();
em.persist(legalEntity);
em.getTransaction().commit();


Chris


-----Original Message-----
From: gilbertoca [mailto:gilbertoca@gmail.com] 
Sent: Friday, 14 May 2010 11:10 PM
To: users@openjpa.apache.org
Subject: Re: InvalidStateException


Hi,

I'm facing the same exception:


> [INFO] Started Jetty Server
> [INFO] Console reloading is ENABLED. Hit ENTER on the console to restart
> the context.
> [Click] [debug] GET http://localhost:8080/legalEntity.htm
> 341  parkPU  INFO   [qtp33344123-18] openjpa.Runtime - Starting OpenJPA
> 2.0.0
> 2711  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 24437939> executing prepstmnt 7908994 SELECT SEQUENCE_SCHEMA,
> SEQUENCE_NAME FROM INFORMATION_SCHEMA.SEQUENCES
> 2711  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 24437939> [0 ms] spent
> 3625  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 27529215> executing prepstmnt 15554028 SELECT t1.id, t1.p_type,
> t1.version, t1.address, t1.name, t0.dt_foundation, t0.taxpayers_id FROM
> park.legal_entity t0 INNER JOIN park.person t1 ON t0.person_id = t1.id
> WHERE t1.p_type = ? [params=(String) LE]
> 3627  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 27529215> [2 ms] spent
> [Click] [info ] renderTemplate: /legalEntity.htm,/border-template.htm -
> 111 ms
> [Click] [info ] handleRequest:  /legalEntity.htm - 4534 ms
> [Click] [debug] POST http://localhost:8080/legalEntity.htm
> [Click] [debug]     Form -> LegalEntity.name : Gilberto
> [Click] [debug]     Form -> LegalEntity.address : rua tal
> [Click] [debug]     Form -> LegalEntity.dtFoundation : Thu May 13 00:00:00
> BRT 2010
> [Click] [debug]     Form -> LegalEntity.taxpayersId : 1135sdfs
> 191  parkPU  INFO   [qtp33344123-22] openjpa.Runtime - Starting OpenJPA
> 2.0.0
> 696  parkPU  TRACE  [qtp33344123-22] openjpa.jdbc.SQL - <t 11570087, conn
> 10530939> executing prepstmnt 17464288 SELECT SEQUENCE_SCHEMA,
> SEQUENCE_NAME FROM INFORMATION_SCHEMA.SEQUENCES
> 696  parkPU  TRACE  [qtp33344123-22] openjpa.jdbc.SQL - <t 11570087, conn
> 10530939> [0 ms] spent
> [Click] [error] handleException: <openjpa-2.0.0-r422266:935683 nonfatal
> user error> org.apache.openjpa.persistence.InvalidStateException: Can only
> perform operation while a transaction is active.
> 	at
>
org.apache.openjpa.kernel.BrokerImpl.assertTransactionOperation(BrokerImpl.j
ava:4595)
> 	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1470)
> 	at
>
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
> 	at
>
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.ja
va:559)
> 	at
park.web.page.LegalEntityPage.onOkClicked(LegalEntityPage.java:99)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57
)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at
org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:1749)
> 	at
>
org.apache.click.util.ActionListenerAdaptor.onAction(ActionListenerAdaptor.j
ava:59)
> 	at
>
org.apache.click.ActionEventDispatcher.fireActionEvent(ActionEventDispatcher
.java:247)
> 	at
>
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:192)
> 	at
>
org.apache.click.ActionEventDispatcher$EventHolder.fireActionEvents(ActionEv
entDispatcher.java:432)
> 	at
>
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:225)
> 	at
>
org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatche
r.java:211)
> 	at
org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:637)
> 	at org.apache.click.ClickServlet.processPage(ClickServlet.java:533)
> 	at
org.apache.click.ClickServlet.handleRequest(ClickServlet.java:363)
> 	at org.apache.click.ClickServlet.doPost(ClickServlet.java:283)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
> 	at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:427)
> 	at
>
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119
)
> 	at
>
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
> 	at
>
org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:1
82)
> 	at
>
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java
:933)
> 	at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
> 	at
>
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:
867)
> 	at
>
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117
)
> 	at
>
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:245)
> 	at
>
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.
java:126)
> 	at
>
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:1
13)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:334)
> 	at
>
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:55
9)
> 	at
>
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnectio
n.java:1007)
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747)
> 	at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209)
> 	at
> org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
> 	at
>
org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.jav
a:462)
> 	at
>
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:4
36)
> 	at java.lang.Thread.run(Thread.java:636)
> [Click] [info ] renderTemplate: /click/error.htm - 72 ms
> [Click] [info ] handleRequest:  /legalEntity.htm - 1140 ms
> 
> 

That's my code:


>     public boolean onOkClicked() {
>         if (form.isValid()) {
>             LegalEntity legalEntity = new LegalEntity();
>             form.copyTo(legalEntity);
> 
>             getEntityManager().getTransaction().begin();
>             getEntityManager().persist(legalEntity);
>             getEntityManager().getTransaction().commit(); //at
> park.web.page.LegalEntityPage.onOkClicked(LegalEntityPage.java:99)
> 
>             form.clearValues();
> 
>             msg = "A new legalEntity record has been created";
>         }
>         return true;
>     }
> 
> 

What does it mean? 

Gilberto
-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5050893.h
tml
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: InvalidStateException

Posted by Daryl Stultz <da...@opentempo.com>.
On Fri, May 14, 2010 at 1:59 PM, gilbertoca <gi...@gmail.com> wrote:

>
> The utility class described in this[1] article is very useful.
> I will try to adapt it to my needs.
>
> That's pretty much how I do it. Take great care if you've never worked with
ThreadLocal before.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
http://www.opentempo.com
mailto:daryl.stultz@opentempo.com

Re: InvalidStateException

Posted by gilbertoca <gi...@gmail.com>.
The utility class described in this[1] article is very useful.
I will try to adapt it to my needs.

Regards,


Gilberto
[1]http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051991.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: InvalidStateException

Posted by Daryl Stultz <da...@opentempo.com>.
On Fri, May 14, 2010 at 10:57 AM, C N Davies <cn...@cndavies.com> wrote:

>  Also for perfomance purposes I keep a cach
> of entity managers so I don't have to continually instantiate new ones
> because of the performance hit of doing so.
>

FWIW, Chris seems to have performance issues instantiating EMs, but I don't.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
http://www.opentempo.com
mailto:daryl.stultz@opentempo.com

RE: InvalidStateException

Posted by C N Davies <cn...@cndavies.com>.
I keep is simple by implementing an EntityService and let it handle the
errors and such, so I can standardise error handling, persisting or merging
decisions etc.  Then I just have a private static instance of the factory so
it gets shared application wide. Also for perfomance purposes I keep a cach
of entity managers so I don't have to continually instantiate new ones
because of the performance hit of doing so. 


Chris





-----Original Message-----
From: gilbertoca [mailto:gilbertoca@gmail.com] 
Sent: Saturday, 15 May 2010 12:48 AM
To: users@openjpa.apache.org
Subject: RE: InvalidStateException


Thanks Chris, now I see the problem.
So my approach is not correct!
Should it be:

EntityManagerFactory --  ServletContext[by a filter or listener]
EntityManager            --  page [by request or session]

Can anyone point me the right direction on the ServletContext[by a filter or
listener] implementation example?

Thanks again,

Gilberto

-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051257.h
tml
Sent from the OpenJPA Users mailing list archive at Nabble.com.


RE: InvalidStateException

Posted by gilbertoca <gi...@gmail.com>.
Thanks Chris, now I see the problem.
So my approach is not correct!
Should it be:

EntityManagerFactory --  ServletContext[by a filter or listener]
EntityManager            --  page [by request or session]

Can anyone point me the right direction on the ServletContext[by a filter or
listener] implementation example?

Thanks again,

Gilberto

-- 
View this message in context: http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051257.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

RE: InvalidStateException

Posted by C N Davies <cn...@cndavies.com>.
You are creating a new entity manager each time you retrieve an entity
manager, hence you will never have a transaction. Use my sample code and it
will work.

>     protected EntityManager getEntityManager() {
>         return emf.createEntityManager(); <----- always creating a new
entity manager
>     }

Chris



-----Original Message-----
From: gilbertoca [mailto:gilbertoca@gmail.com] 
Sent: Saturday, 15 May 2010 12:03 AM
To: users@openjpa.apache.org
Subject: Re: InvalidStateException



Rick Curtis wrote:
> 
> The message means that you don't have an active transaction to commit....
> :-) Is it possible that your getEntityManager() method call isn't
> returning
> the same em?
> 
> 

This one is my general apache click page[1] which my regular page classes
extends (like the LegalEntityPage ):


> public class BorderPage extends Page {
> 
>     /** The root menu. */
>     protected Menu rootMenu = Menu.getRootMenu();
>     //@PersistenceContext protected EntityManager em;
>     protected EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("parkPU");
> 
>     public BorderPage() {
>         addModel("title", "Main Page");
>     }
> 
>     /**
>      * Returns the name of the border template: &nbsp;
> <tt>"/border-template.htm"</tt>
>      *
>      * @see Page#getTemplate()
>      */
>     public String getTemplate() {
>         return "/border-template.htm";
>     }
> 
>     protected EntityManager getEntityManager() {
>         return emf.createEntityManager();
>     }
> }
> 

Is there anything wrong with this approach?

Regards,

Gilberto

[1]http://click.apache.org/docs/click-api/org/apache/click/Page.html
-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051070.h
tml
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: InvalidStateException

Posted by gilbertoca <gi...@gmail.com>.

Rick Curtis wrote:
> 
> The message means that you don't have an active transaction to commit....
> :-) Is it possible that your getEntityManager() method call isn't
> returning
> the same em?
> 
> 

This one is my general apache click page[1] which my regular page classes
extends (like the LegalEntityPage ):


> public class BorderPage extends Page {
> 
>     /** The root menu. */
>     protected Menu rootMenu = Menu.getRootMenu();
>     //@PersistenceContext protected EntityManager em;
>     protected EntityManagerFactory emf =
> Persistence.createEntityManagerFactory("parkPU");
> 
>     public BorderPage() {
>         addModel("title", "Main Page");
>     }
> 
>     /**
>      * Returns the name of the border template: &nbsp;
> <tt>"/border-template.htm"</tt>
>      *
>      * @see Page#getTemplate()
>      */
>     public String getTemplate() {
>         return "/border-template.htm";
>     }
> 
>     protected EntityManager getEntityManager() {
>         return emf.createEntityManager();
>     }
> }
> 

Is there anything wrong with this approach?

Regards,

Gilberto

[1]http://click.apache.org/docs/click-api/org/apache/click/Page.html
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5051070.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: InvalidStateException

Posted by Rick Curtis <cu...@gmail.com>.
The message means that you don't have an active transaction to commit....
:-) Is it possible that your getEntityManager() method call isn't returning
the same em?

Re: InvalidStateException

Posted by gilbertoca <gi...@gmail.com>.
Hi,

I'm facing the same exception:


> [INFO] Started Jetty Server
> [INFO] Console reloading is ENABLED. Hit ENTER on the console to restart
> the context.
> [Click] [debug] GET http://localhost:8080/legalEntity.htm
> 341  parkPU  INFO   [qtp33344123-18] openjpa.Runtime - Starting OpenJPA
> 2.0.0
> 2711  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 24437939> executing prepstmnt 7908994 SELECT SEQUENCE_SCHEMA,
> SEQUENCE_NAME FROM INFORMATION_SCHEMA.SEQUENCES
> 2711  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 24437939> [0 ms] spent
> 3625  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 27529215> executing prepstmnt 15554028 SELECT t1.id, t1.p_type,
> t1.version, t1.address, t1.name, t0.dt_foundation, t0.taxpayers_id FROM
> park.legal_entity t0 INNER JOIN park.person t1 ON t0.person_id = t1.id
> WHERE t1.p_type = ? [params=(String) LE]
> 3627  parkPU  TRACE  [qtp33344123-18] openjpa.jdbc.SQL - <t 17368622, conn
> 27529215> [2 ms] spent
> [Click] [info ] renderTemplate: /legalEntity.htm,/border-template.htm -
> 111 ms
> [Click] [info ] handleRequest:  /legalEntity.htm - 4534 ms
> [Click] [debug] POST http://localhost:8080/legalEntity.htm
> [Click] [debug]     Form -> LegalEntity.name : Gilberto
> [Click] [debug]     Form -> LegalEntity.address : rua tal
> [Click] [debug]     Form -> LegalEntity.dtFoundation : Thu May 13 00:00:00
> BRT 2010
> [Click] [debug]     Form -> LegalEntity.taxpayersId : 1135sdfs
> 191  parkPU  INFO   [qtp33344123-22] openjpa.Runtime - Starting OpenJPA
> 2.0.0
> 696  parkPU  TRACE  [qtp33344123-22] openjpa.jdbc.SQL - <t 11570087, conn
> 10530939> executing prepstmnt 17464288 SELECT SEQUENCE_SCHEMA,
> SEQUENCE_NAME FROM INFORMATION_SCHEMA.SEQUENCES
> 696  parkPU  TRACE  [qtp33344123-22] openjpa.jdbc.SQL - <t 11570087, conn
> 10530939> [0 ms] spent
> [Click] [error] handleException: <openjpa-2.0.0-r422266:935683 nonfatal
> user error> org.apache.openjpa.persistence.InvalidStateException: Can only
> perform operation while a transaction is active.
> 	at
> org.apache.openjpa.kernel.BrokerImpl.assertTransactionOperation(BrokerImpl.java:4595)
> 	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1470)
> 	at
> org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
> 	at
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:559)
> 	at park.web.page.LegalEntityPage.onOkClicked(LegalEntityPage.java:99)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:616)
> 	at org.apache.click.util.ClickUtils.invokeListener(ClickUtils.java:1749)
> 	at
> org.apache.click.util.ActionListenerAdaptor.onAction(ActionListenerAdaptor.java:59)
> 	at
> org.apache.click.ActionEventDispatcher.fireActionEvent(ActionEventDispatcher.java:247)
> 	at
> org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:192)
> 	at
> org.apache.click.ActionEventDispatcher$EventHolder.fireActionEvents(ActionEventDispatcher.java:432)
> 	at
> org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:225)
> 	at
> org.apache.click.ActionEventDispatcher.fireActionEvents(ActionEventDispatcher.java:211)
> 	at org.apache.click.ClickServlet.performOnProcess(ClickServlet.java:637)
> 	at org.apache.click.ClickServlet.processPage(ClickServlet.java:533)
> 	at org.apache.click.ClickServlet.handleRequest(ClickServlet.java:363)
> 	at org.apache.click.ClickServlet.doPost(ClickServlet.java:283)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
> 	at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:427)
> 	at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> 	at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
> 	at
> org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
> 	at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
> 	at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
> 	at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
> 	at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> 	at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
> 	at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
> 	at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
> 	at org.eclipse.jetty.server.Server.handle(Server.java:334)
> 	at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
> 	at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007)
> 	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747)
> 	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209)
> 	at
> org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
> 	at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
> 	at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
> 	at java.lang.Thread.run(Thread.java:636)
> [Click] [info ] renderTemplate: /click/error.htm - 72 ms
> [Click] [info ] handleRequest:  /legalEntity.htm - 1140 ms
> 
> 

That's my code:


>     public boolean onOkClicked() {
>         if (form.isValid()) {
>             LegalEntity legalEntity = new LegalEntity();
>             form.copyTo(legalEntity);
> 
>             getEntityManager().getTransaction().begin();
>             getEntityManager().persist(legalEntity);
>             getEntityManager().getTransaction().commit(); //at
> park.web.page.LegalEntityPage.onOkClicked(LegalEntityPage.java:99)
> 
>             form.clearValues();
> 
>             msg = "A new legalEntity record has been created";
>         }
>         return true;
>     }
> 
> 

What does it mean? 

Gilberto
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/InvalidStateException-tp210537p5050893.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: InvalidStateException

Posted by Tedman Leung <te...@sfu.ca>.
my guess is that it means you haven't started a transaction yet.

have you?


> I get this message when trying to persist an Entity:
> 
> Exception in thread "AWT-EventQueue-0" <openjpa-1.0.1-r420667:592145 nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Can only perform operation while a transaction is active.
> 
> What does it mean?
> 
> --
> Morten Bendiksen
> 
> The information contained in this message is sent in the strictest confidence for the addressee only.  It is intended only for the use of the addressee and may contain legally privileged information.  If you have received this e-mail in error you are requested to preserve its confidentiality and advise the sender of the error in transmission.
> It is the responsibility of the addressee to scan this email and any attachments for computer viruses or other defects.  The sender  does not accept liability for any loss or damage of any nature, however caused, which may result directly or indirectly from this email or any file attached.
> All mail from TecWel AS are scanned by both hardware and software antispam and antivirus filters.

-- 
                                                           Ted Leung
                                                           tedman@sfu.ca

I am what what the world has taught me to be.