This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256361 - Jpql and zero primary key
Summary: Jpql and zero primary key
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-04 13:55 UTC by nektarios
Modified: 2015-11-04 14:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nektarios 2015-11-04 13:55:20 UTC
Create a new Project, connect to a mysql db having a table (test) with 2 fields
id - int - primary
name - varchar

now enter a record where id equals zero ie

0 - testing

Use the wizard to create entities from database. Right click on persistence.xml and try to run a jpql query ie

SELECT t FROM Test 

it fails with "java.lang.IllegalStateException: 
Exception Description: No transaction is currently active
	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.rollback(EntityTransactionImpl.java:176)"


After some trials i found out that this happens ONLY if you run the query from JPQL editor.
Comment 1 nektarios 2015-11-04 14:15:34 UTC
i know that setting primary to zero is strange and even bad practice.