Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Unable to insert single entity
Unable to insert single entity [message #385256] Thu, 15 January 2009 18:32 Go to next message
Johannes Stamminger is currently offline Johannes StammingerFriend
Messages: 17
Registered: July 2009
Junior Member
Hi again,


this drives me crazy:
I query for entities. If none found I create an entity, persist it and
shutdown everything. Looking into the database (by unit test or squirrel
sql) does not show any entry in the table.

Creating a dummy 2nd entity and persisting both in one transaction, they
both show up.

When removing the dummy entity within the same or next transaction (using
the same entity manager instance) the table is empty again.

Creating a dummy 3rd entity and persisting all three in one transaction,
all three show up.

Removing the dummy 2nd entity in the same transaction having added all
three before, the first and the 3rd entity remain in the table.

Modifying the initial query not exclude the dummy entity, the table again
stays blank.

I disable the querying for entities completely and everything behaves as
expected (without any dummies).

Using a different entity manager instance for the query does not help
eighther.


VERY strange ... any explanation?
Re: Unable to insert single entity [message #385258 is a reply to message #385256] Thu, 15 January 2009 19:22 Go to previous messageGo to next message
Johannes Stamminger is currently offline Johannes StammingerFriend
Messages: 17
Registered: July 2009
Junior Member
OK, I just found that this deals with connecting a second time to the same
database from within the test. The tables are dropped and created again
... though I do specify the ";create=false" in the jdbc connect url ...

By what way do I prevent this?

JOhannes
Re: Unable to insert single entity [message #385260 is a reply to message #385258] Thu, 15 January 2009 19:28 Go to previous message
Johannes Stamminger is currently offline Johannes StammingerFriend
Messages: 17
Registered: July 2009
Junior Member
Forget about those posts, seems caused by drop-and-create-tables in
persistence.xml.

Too late for me,
Johannes
Previous Topic:OutOfMemory for simple example persisting large amount of data
Next Topic:NullPointerException for all non Embedded classes
Goto Forum:
  


Current Time: Fri Apr 26 00:27:38 GMT 2024

Powered by FUDForum. Page generated in 0.03708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top