DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCACCESS-73
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Martin Groves
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus AccessPlatform

Table autocreate hang on Postgresql when persisting an object with a reference to a previously queried instance.

Created: 26/Aug/10 03:52 PM   Updated: 17/Nov/10 09:29 PM   Resolved: 20/Sep/10 11:04 AM
Component/s: None
Affects Version/s: 2.0.1, 2.2.0.m1
Fix Version/s: None

File Attachments: 1. Zip Archive test.zip (5 kB)

Environment: OS X

Datastore: PostgreSQL
Severity: Development


 Description  « Hide
Class B contains a reference to an instance of class A.

Persisting an instance of class B after querying the database for it's referenced instance of A results in a stall.

Note: Tables A and B must not already exist.

Martin Groves added a comment - 26/Aug/10 03:53 PM
Test Case

Martin Groves made changes - 26/Aug/10 03:53 PM
Field Original Value New Value
Attachment test.zip [ 11242 ]
Andy Jefferson made changes - 20/Sep/10 11:02 AM
Summary Table autocreate failure when persisting an object with a reference to a previously queried instance. Table autocreate hang on Postgresql when persisting an object with a reference to a previously queried instance.
Andy Jefferson added a comment - 20/Sep/10 11:04 AM
This is due to Postgresql's JDBC driver which doesn't allow DDL and normal SQL in a single txn; works in other RDBMS. Hence marking as won't fix.
Happens with the issue of the statement
ALTER TABLE "B" ADD CONSTRAINT "B_FK1" FOREIGN KEY ("T1_ID_OID") REFERENCES "A" ("ID") INITIALLY DEFERRED


The workaround is simple ... use SchemaTool before using it at runtime (as per all docs recommended practice).

Andy Jefferson made changes - 20/Sep/10 11:04 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Andy Jefferson made changes - 17/Nov/10 09:29 PM
Status Resolved [ 5 ] Closed [ 6 ]