Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Error on Test #2 JPA/DCN Example Code(Error running example code: EclipseLink/Examples/JPA/DCN)
Error on Test #2 JPA/DCN Example Code [message #906203] Fri, 31 August 2012 20:53 Go to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Hello. As can be seen at the very bottom of this post, the example starts to run however it fails on the second test. I believe it has to do with the earlier warnings which are indications that things are not being set up properly. I am surprised that the author did not encounter these issues as well. I tried using @IdClass in the OrderLine class to no avail. I don't think it's hurting that the tables are trying to be recreated, even though it puts out errors. I changed the log level from 'FINE' to 'WARNING' but can change it back if necessary. Has anyone seen this problem? Does anyone have any suggestions please? Thanks.


C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn>ant example
Buildfile: C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\build.xml

clean:
[delete] Deleting directory C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\classes

init:
[mkdir] Created dir: C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\classes
build:
[echo] org.eclipse.persistence.example.jpa.databaseevent: C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\build.xml
[javac] C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\build.xml:24: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 4 source files to C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\classes
[copy] Copying 1 file to C:\Documents and Settings\schenkjd\My Documents\NetBeansProjects\jpa-dcn\classes\META-INF

example:
[java] [EL Warning]: metadata: 2012-08-31 16:35:07.192--ServerSession(30199356)--You have specified multiple ids for the entity class [model.OrderLine] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have touse JPQL queries to read your entities. For other id options see @PrimaryKey.
[java] [EL Warning]: metadata: 2012-08-31 16:35:07.27--ServerSession(32392776)--You have specified multiple ids for the entity class [model.OrderLine] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have touse JPQL queries to read your entities. For other id options see @PrimaryKey.
[java] Setting up database.
[java] [EL Warning]: metadata: 2012-08-31 16:35:07.301--ServerSession(25589390)--You have specified multiple ids for the entity class [model.OrderLine] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have to use JPQL queries to read your entities. For other id options see @PrimaryKey.
[java] [EL Warning]: sql: 2012-08-31 16:35:09.52--ServerSession(25589390)--
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
[java]
[java] Setup complete.
[java] [EL Warning]: metadata: 2012-08-31 16:36:00.661--ServerSession(28819334)--You have specified multiple ids for the entity class [model.OrderLine] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have to use JPQL queries to read your entities. For other id options see @PrimaryKey.
[java] [EL Warning]: metadata: 2012-08-31 16:36:00.677--ServerSession(11147203)--You have specified multiple ids for the entity class [model.OrderLine] without specifying an @IdClass. By doing this you may lose the ability to find by identity, distributed cache support etc. Note: You may however use entity manager find operations by passing a list of primary key fields. Else, you will have to use JPQL queries to read your entities. For other id options see @PrimaryKey.
[java] [EL Warning]: 2012-08-31 16:36:01.927--ServerSession(28819334)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_ORDER (ORDER_ID NUMBER(19) NOT NULL, DESCRIPT
ION VARCHAR2(255) NULL, TOTALCOST NUMBER(38) NULL, VERSION NUMBER(19) NULL, CUST
OMER_ID NUMBER(19) NULL, PRIMARY KEY (ORDER_ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_ORDER (ORDER_ID NUMBER(
19) NOT NULL, DESCRIPTION VARCHAR2(255) NULL, TOTALCOST NUMBER(38) NULL, VERSION
NUMBER(19) NULL, CUSTOMER_ID NUMBER(19) NULL, PRIMARY KEY (ORDER_ID))")
[java] [EL Warning]: 2012-08-31 16:36:15.505--ServerSession(28819334)--Exce
ption [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652)
: org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_ORDERLINE (LINENUMBER NUMBER(10) NOT NULL, CO
ST NUMBER(38) NULL, DESCRIPTION VARCHAR2(255) NULL, ORDER_ID NUMBER(19) NOT NULL
, PRIMARY KEY (LINENUMBER, ORDER_ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_ORDERLINE (LINENUMBER N
UMBER(10) NOT NULL, COST NUMBER(38) NULL, DESCRIPTION VARCHAR2(255) NULL, ORDER_
ID NUMBER(19) NOT NULL, PRIMARY KEY (LINENUMBER, ORDER_ID))")
[java] [EL Warning]: 2012-08-31 16:36:15.63--ServerSession(28819334)--Excep
tion [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652):
org.eclipse.persistence.exceptions.DatabaseException: org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_CUSTOMER (ID NUMBER(19) NOT NULL, NAME VARCHA
R2(255) NULL, VERSION NUMBER(19) NULL, PRIMARY KEY (ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_CUSTOMER (ID NUMBER(19)
NOT NULL, NAME VARCHAR2(255) NULL, VERSION NUMBER(19) NULL, PRIMARY KEY (ID))")

[java] [EL Warning]: 2012-08-31 16:24:29.367--ServerSession(11147203)--Exce
ption [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-02275: such a referential constraint already exists in the table
[java]
[java] Error Code: 2275
[java] Call: ALTER TABLE DBE_ORDER ADD CONSTRAINT FK_DBE_ORDER_CUSTOMER_ID
FOREIGN KEY (CUSTOMER_ID) REFERENCES DBE_CUSTOMER (ID)
[java] Query: DataModifyQuery(sql="ALTER TABLE DBE_ORDER ADD CONSTRAINT FK_
DBE_ORDER_CUSTOMER_ID FOREIGN KEY (CUSTOMER_ID) REFERENCES DBE_CUSTOMER (ID)")
[java] [EL Warning]: 2012-08-31 16:24:29.539--ServerSession(11147203)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652) : org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-02275: such a referential constraint already exists in the table
[java]
[java] Error Code: 2275
[java] Call: ALTER TABLE DBE_ORDERLINE ADD CONSTRAINT FK_DBE_ORDERLINE_ORDE
R_ID FOREIGN KEY (ORDER_ID) REFERENCES DBE_ORDER (ORDER_ID)
[java] Query: DataModifyQuery(sql="ALTER TABLE DBE_ORDERLINE ADD CONSTRAINT
FK_DBE_ORDERLINE_ORDER_ID FOREIGN KEY (ORDER_ID) REFERENCES DBE_ORDER (ORDER_ID
)")
[java] [EL Warning]: 2012-08-31 16:24:29.742--ServerSession(11147203)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR2(50) NOT NULL, SEQ_COUNT NUMBER(38) NULL, PRIMARY KEY (SEQ_NAME))
[java] Query: DataModifyQuery(sql="CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR2
(50) NOT NULL, SEQ_COUNT NUMBER(38) NULL, PRIMARY KEY (SEQ_NAME))")
[java]
[java]
[java] Starting example.
[java]
[java]
[java] Selecting all customer on application #2.
[java]
[java]
[java] Inserting new customer on application #1.
[java]
[java]
[java] Selecting new customer on application #2.
[java]
[java]
[java] Customer name on application #1: Test1
[java] Customer name on application #2: Test1
[java]
[java]
[java] Updating customer name to 'Test2' on application #1.
[java]
[java]
[java] Selecting customer on application #2.
[java]
[java]
[java] Customer name on application #1: Test2
[java] Customer name on application #2: Test1
[java] java.lang.RuntimeException: Test #2 failed
[java] at example.Example.run(Example.java:116)
[java] at example.Example.main(Example.java:35)

BUILD SUCCESSFUL
Total time: 1 minute 30 seconds
Re: Error on Test #2 JPA/DCN Example Code [message #908104 is a reply to message #906203] Tue, 04 September 2012 18:23 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Logging for the OracleChangeNotificationListener class only occurs at the Finest level, and any messages that might indicate why the listener is not being registered are being lost.
Please upload the log with the level set to FINEST or ALL. You might also try increasing the value used for the SLEEP variable in the test to make sure it is not a delay in the database change event processing.

Best Regards,
Chris

[Updated on: Tue, 04 September 2012 18:28]

Report message to a moderator

Re: Error on Test #2 JPA/DCN Example Code [message #908161 is a reply to message #908104] Tue, 04 September 2012 21:10 Go to previous messageGo to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Thank you for the message. I did both things- increased the sleep time and changed the log level to 'FINEST'. Following is the tail- hope it is enough but not too much (see end please).

I actually did some digging myself and notice that "ORA-29970: Specified registration id does not exist" indicates that I might need to "Clear out Change Notification Registrations". I have asked my DBA if he's willing to do that. Could the connection pool have passed an incorrect regid value to the dbms_chnf procedure? Any additional thoughts and suggestions are much welcomed and appreciated.

Here's the end of the log messages:
...
in])--JavaSECMPInitializer - global instrumentation is null.
[java] [EL Finest]: jpa: 2012-09-04 16:15:12.551--ServerSession(2978880)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit order2; session
order2; state Predeployed; factoryCount 0
[java] [EL Finest]: jpa: 2012-09-04 16:15:12.567--ServerSession(2978880)--Thread(Thread[main,5,main])--End predeploying Persistence Unit order2; session order2; state Predeployed; factoryCount 1
[java] [EL Warning]: 2012-09-04 16:15:13.833--ServerSession(29326115)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: nam
e is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_ORDER (ORDER_ID NUMBER(19) NOT NULL, DESCRIPT
ION VARCHAR2(255) NULL, TOTALCOST NUMBER(38) NULL, VERSION NUMBER(19) NULL, CUST
OMER_ID NUMBER(19) NULL, PRIMARY KEY (ORDER_ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_ORDER (ORDER_ID NUMBER(
19) NOT NULL, DESCRIPTION VARCHAR2(255) NULL, TOTALCOST NUMBER(38) NULL, VERSION
NUMBER(19) NULL, CUSTOMER_ID NUMBER(19) NULL, PRIMARY KEY (ORDER_ID))")
[java] [EL Warning]: 2012-09-04 16:15:14.02--ServerSession(29326115)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652):
org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_ORDERLINE (LINENUMBER NUMBER(10) NOT NULL, CO
ST NUMBER(38) NULL, DESCRIPTION VARCHAR2(255) NULL, ORDER_ID NUMBER(19) NOT NULL
, PRIMARY KEY (LINENUMBER, ORDER_ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_ORDERLINE (LINENUMBER NUMBER(10) NOT NULL, COST NUMBER(38) NULL, DESCRIPTION VARCHAR2(255) NULL, ORDER_
ID NUMBER(19) NOT NULL, PRIMARY KEY (LINENUMBER, ORDER_ID))")
[java] [EL Warning]: 2012-09-04 16:15:14.27--ServerSession(29326115)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652):
org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE DBE_CUSTOMER (ID NUMBER(19) NOT NULL, NAME VARCHA
R2(255) NULL, VERSION NUMBER(19) NULL, PRIMARY KEY (ID))
[java] Query: DataModifyQuery(sql="CREATE TABLE DBE_CUSTOMER (ID NUMBER(19)
NOT NULL, NAME VARCHAR2(255) NULL, VERSION NUMBER(19) NULL, PRIMARY KEY (ID))")

[java] [EL Warning]: 2012-09-04 16:15:14.473--ServerSession(29326115)--Exce
ption [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652)
: org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-02275: such a referential constraint already exists in the table
[java]
[java] Error Code: 2275
[java] Call: ALTER TABLE DBE_ORDER ADD CONSTRAINT FK_DBE_ORDER_CUSTOMER_ID
FOREIGN KEY (CUSTOMER_ID) REFERENCES DBE_CUSTOMER (ID)
[java] Query: DataModifyQuery(sql="ALTER TABLE DBE_ORDER ADD CONSTRAINT FK_
DBE_ORDER_CUSTOMER_ID FOREIGN KEY (CUSTOMER_ID) REFERENCES DBE_CUSTOMER (ID)")
[java] [EL Warning]: 2012-09-04 16:15:14.583--ServerSession(29326115)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-02275: suc
h a referential constraint already exists in the table
[java]
[java] Error Code: 2275
[java] Call: ALTER TABLE DBE_ORDERLINE ADD CONSTRAINT FK_DBE_ORDERLINE_ORDE
R_ID FOREIGN KEY (ORDER_ID) REFERENCES DBE_ORDER (ORDER_ID)
[java] Query: DataModifyQuery(sql="ALTER TABLE DBE_ORDERLINE ADD CONSTRAINT
FK_DBE_ORDERLINE_ORDER_ID FOREIGN KEY (ORDER_ID) REFERENCES DBE_ORDER (ORDER_ID
)")
[java] [EL Warning]: 2012-09-04 16:15:14.801--ServerSession(29326115)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652)
: org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object
[java]
[java] Error Code: 955
[java] Call: CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR2(50) NOT NULL, SEQ_COUNT NUMBER(38) NULL, PRIMARY KEY (SEQ_NAME))
[java] Query: DataModifyQuery(sql="CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR2
(50) NOT NULL, SEQ_COUNT NUMBER(38) NULL, PRIMARY KEY (SEQ_NAME))")
[java]
[java]
[java] Starting example.
[java]
[java]
[java] Selecting all customer on application #2.
[java] [EL Finest]: jpa: 2012-09-04 16:15:15.129--ServerSession(2978880)--Thread(Thread[main,5,main])--Begin deploying Persistence Unit order2; session order2; state Predeployed; factoryCount 1
[java] [EL Finer]: 2012-09-04 16:15:15.129--ServerSession(2978880)--Thread(
Thread[main,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
[java] [EL Finest]: properties: 2012-09-04 16:15:15.129--ServerSession(2978
880)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
[java] [EL Finest]: properties: 2012-09-04 16:15:15.223--ServerSession(2978
880)--Thread(Thread[main,5,main])--property=eclipselink.logging.level; value=FIN
EST; translated value=FINEST
[java] [EL Finest]: properties: 2012-09-04 16:15:15.223--ServerSession(2978
880)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.user; value=f
pa_dev
[java] [EL Finest]: properties: 2012-09-04 16:15:15.223--ServerSession(2978880)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.password; value=xxxxxx
[java] [EL Finest]: properties: 2012-09-04 16:15:15.239--ServerSession(2978880)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value
=oracle.jdbc.OracleDriver
[java] [EL Finest]: properties: 2012-09-04 16:15:15.254--ServerSession(2978
880)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.url; value=jd
bc:oracle:thin:@scladb08.fuel.wec.com:1521:dev
[java] [EL Finest]: properties: 2012-09-04 16:15:15.254--ServerSession(2978
880)--Thread(Thread[main,5,main])--property=eclipselink.cache.database-event-lis
tener; value=org.eclipse.persistence.platform.database.oracle.dcn.OracleChangeNo
tificationListener
[java] [EL Info]: 2012-09-04 16:15:15.254--ServerSession(2978880)--Thread(Thread[main,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.4.0.v20120608-r11652
[java] [EL Finest]: dbPlatformHelper_regExprDbPlatform: 2012-09-04 16:15:15
.864--Thread(Thread[main,5,main])--(?i)oracle.*11 (There is no English translati
on for this message.)
[java] [EL Fine]: connection: 2012-09-04 16:15:15.864--Thread(Thread[main,5,main])--Detected database platform: org.eclipse.persistence.platform.database.o
racle.Oracle11Platform
[java] [EL Config]: connection: 2012-09-04 16:15:15.895--ServerSession(2978880)--Connection(6447371)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
[java] platform=>Oracle11Platform
[java] user name=> ""
[java] datasource URL=> "jdbc:oracle:thin:@:1521:dev"
[java] ))
[java] [EL Config]: connection: 2012-09-04 16:15:16.426--ServerSession(2978880)--Connection(13709034)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@:1521:dev
[java] User: FPA_DEV
[java] Database: Oracle Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
[java] With the Partitioning, OLAP, Data Mining and Real Application Testing options
[java] Driver: Oracle JDBC driver Version: 11.2.0.3.0
[java] [EL Finest]: connection: 2012-09-04 16:15:16.426--ServerSession(2978880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
[java] [EL Finest]: connection: 2012-09-04 16:15:16.52--ServerSession(2978880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection released to connection pool [default].
[java] [EL Finest]: sequencing: 2012-09-04 16:15:16.52--ServerSession(2978880)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_Transaction_NoAccessor_State
[java] [EL Finest]: sequencing: 2012-09-04 16:15:16.52--ServerSession(2978880)--Thread(Thread[main,5,main])--sequence ORD_SEQ: preallocation size 50
[java] [EL Finest]: sequencing: 2012-09-04 16:15:16.52--ServerSession(2978880)--Thread(Thread[main,5,main])--sequence CUST_SEQ: preallocation size 50
[java] [EL Info]: connection: 2012-09-04 16:15:16.536--ServerSession(2978880)--Thread(Thread[main,5,main])--order2 login successful
[java] [EL Finest]: connection: 2012-09-04 16:15:16.536--ServerSession(2978880)--Thread(Thread[main,5,main])--Registering for database change event notification.
[java] [EL Finest]: connection: 2012-09-04 16:15:16.723--ServerSession(2978880)--Thread(Thread[main,5,main])--Registering table [DBE_CUSTOMER] for database
change event notification.
[java] [EL Finer]: metamodel: 2012-09-04 16:15:16.739--ServerSession(297888
0)--Thread(Thread[main,5,main])--Canonical Metamodel class [model.OrderLine_] not found during initialization.
[java] [EL Finer]: metamodel: 2012-09-04 16:15:16.739--ServerSession(297888
0)--Thread(Thread[main,5,main])--Canonical Metamodel class [model.Order_] not fo
und during initialization.
[java] [EL Finer]: metamodel: 2012-09-04 16:15:16.77--ServerSession(2978880
)--Thread(Thread[main,5,main])--Canonical Metamodel class [model.Customer_] not
found during initialization.
[java] [EL Finest]: jpa: 2012-09-04 16:15:16.77--ServerSession(2978880)--Th
read(Thread[main,5,main])--End deploying Persistence Unit order2; session order2
; state Deployed; factoryCount 1
[java] [EL Finer]: connection: 2012-09-04 16:15:16.77--ServerSession(297888
0)--Thread(Thread[main,5,main])--client acquired: 24615045
[java] [EL Finer]: transaction: 2012-09-04 16:15:16.77--ClientSession(24615
045)--Thread(Thread[main,5,main])--acquire unit of work: 12482247
[java] [EL Finest]: query: 2012-09-04 16:15:16.77--UnitOfWork(12482247)--Th
read(Thread[main,5,main])--Execute query ReadAllQuery(referenceClass=Customer sql="SELECT ID, NAME, VERSION, ROWID FROM DBE_CUSTOMER")
[java] [EL Finest]: connection: 2012-09-04 16:15:16.77--ServerSession(2978880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection acquired from
connection pool [default].
[java] [EL Fine]: sql: 2012-09-04 16:15:16.77--ServerSession(2978880)--Connection(13709034)--Thread(Thread[main,5,main])--SELECT ID, NAME, VERSION, ROWID FROM DBE_CUSTOMER
[java] [EL Finest]: connection: 2012-09-04 16:15:17.411--ServerSession(2978
880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection released to
connection pool [default].
[java]
[java]
[java] Inserting new customer on application #1.
[java]
[java]
[java] Selecting new customer on application #2.
[java] [EL Finer]: connection: 2012-09-04 16:16:57.772--ServerSession(29788
80)--Thread(Thread[main,5,main])--client acquired: 8861475
[java] [EL Finer]: transaction: 2012-09-04 16:16:57.772--ClientSession(8861
475)--Thread(Thread[main,5,main])--acquire unit of work: 20245380
[java] [EL Finest]: query: 2012-09-04 16:16:57.772--UnitOfWork(20245380)--T
hread(Thread[main,5,main])--Execute query ReadObjectQuery(referenceClass=Custome
r jpql="Select c from Customer c where c.id = 201")
[java] [EL Finest]: connection: 2012-09-04 16:16:57.772--ServerSession(2978
880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
[java] [EL Fine]: sql: 2012-09-04 16:16:57.819--ServerSession(2978880)--Con
nection(13709034)--Thread(Thread[main,5,main])--SELECT ID, NAME, VERSION, ROWID
FROM DBE_CUSTOMER WHERE (ID = ?)
[java] bind => [201]
[java] [EL Finest]: connection: 2012-09-04 16:16:57.866--ServerSession(2978
880)--Connection(13709034)--Thread(Thread[main,5,main])--Connection released to
connection pool [default].
[java]
[java]
[java] Customer name on application #1: Test1
[java] Customer name on application #2: Test1
[java]
[java]
[java] Updating customer name to 'Test2' on application #1.
[java]
[java]
[java] Selecting customer on application #2.
[java] [EL Finer]: connection: 2012-09-04 16:18:37.977--ServerSession(2978880)--Thread(Thread[main,5,main])--client acquired: 11382417
[java] [EL Finer]: transaction: 2012-09-04 16:18:37.977--ClientSession(11382417)--Thread(Thread[main,5,main])--acquire unit of work: 10479694
[java] [EL Finest]: query: 2012-09-04 16:18:37.993--UnitOfWork(10479694)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(referenceClass=Custome
r jpql="Select c from Customer c where c.id = 201")
[java] [EL Finest]: transaction: 2012-09-04 16:18:37.993--UnitOfWork(10479694)--Thread(Thread[main,5,main])--Register the existing object model.Customer@4c71d2
[java]
[java]
[java] Customer name on application #1: Test2
[java] Customer name on application #2: Test1
[java] Local Exception Stack:
[java] Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
[java] Internal Exception: java.sql.SQLException: ORA-29970: Specified registration id does not exist
[java]
[java] Error Code: 29970
[java] at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324)
[java] at org.eclipse.persistence.platform.database.oracle.dcn.OracleChangeNotificationListener.remove(OracleChangeNotificationListener.java:249)
[java] at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.logout(DatabaseSessionImpl.java:888)
[java] at org.eclipse.persistence.sessions.server.ServerSession.logout(ServerSession.java:748)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.removeSessionFromGlobalSessionManager(EntityManagerSetupImpl.java:396)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.undeploy(EntityManagerSetupImpl.java:2392)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.close(EntityManagerFactoryDelegate.java:249)
[java] at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:267)
[java] at example.Example.run(Example.java:192)
[java] at example.Example.main(Example.java:35)
[java] Caused by: java.sql.SQLException: ORA-29970: Specified registration id does not exist
[java]
[java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
[java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
[java] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
[java] at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:600)
[java] at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
[java] at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
[java] at oracle.jdbc.driver.T4CTTIokpn.doOKPN(T4CTTIokpn.java:282)
[java] at oracle.jdbc.driver.T4CConnection.doUnregisterDatabaseChangeNotification(T4CConnection.java:4560)
[java] at oracle.jdbc.driver.T4CConnection.doUnregisterDatabaseChangeNo\tification(T4CConnection.java:4606)
[java] at oracle.jdbc.driver.PhysicalConnection.unregisterDatabaseChang
eNotification(PhysicalConnection.java:10624)
[java] at org.eclipse.persistence.platform.database.oracle.dcn.OracleCh
angeNotificationListener.remove(OracleChangeNotificationListener.java:247)
[java] ... 8 more
[java] [EL Config]: metadata: 2012-09-04 16:15:12.52--ServerSession(2978880

)--Thread(Thread[main,5,main])--The foreign key column name for the mapping elem
Re: Error on Test #2 JPA/DCN Example Code [message #909052 is a reply to message #908161] Thu, 06 September 2012 13:11 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I have not seen that error, but from your log you are not getting any events from the database.

My guess is that you have not granted your user the change notification privileged on the database,

GRANT CHANGE NOTIFICATION TO FPA_DEV


James : Wiki : Book : Blog : Twitter
Re: Error on Test #2 JPA/DCN Example Code [message #909121 is a reply to message #909052] Thu, 06 September 2012 15:14 Go to previous messageGo to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Verified that the privilege is granted to FPA_DEV. Database version is 11gR2.
Any other suggestions will be much appreciated.
Re: Error on Test #2 JPA/DCN Example Code [message #911335 is a reply to message #909121] Tue, 11 September 2012 12:15 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

My only other suggestion is to try restarting the database, or try a different database install.

James : Wiki : Book : Blog : Twitter
Re: Error on Test #2 JPA/DCN Example Code [message #964508 is a reply to message #911335] Tue, 30 October 2012 15:29 Go to previous messageGo to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
I tried from scratch again and am attaching a full log with logging set to FINEST. Obviously I'm connecting to the DB. And I see the registering and unregistering of the DCN. Is there anything specific for which I can look? I'm not sure why I see all of the "name is already in use" exceptions since I explicitly dropped all of the tables from the database before retrying the example.

ANY suggestions will be welcomed. I'd really like to get this example working. I'm gathering it worked for the person who posted it and I'm following the instructions.

Thank you.
Re: Error on Test #2 JPA/DCN Example Code [message #987450 is a reply to message #964508] Mon, 26 November 2012 16:32 Go to previous messageGo to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Hello again. I was able to work with the DBA to try both suggestions from 9/11 of restarting the DB and trying a different install. Unfortunately neither of those helped and I received the same result. I am walking through the code and log in Netbeans and have read the 'Oracle Database Change Notification documentation' link at the bottom of the example and am coming up with some additional thoughts and questions. I can see the DBE_CUSTOMER table being registered for the database change notifications a few times however only on queries. In particular, I see a registration during the query prior to the insertion of the first customer however I do NOT see it during the very next query, the one after the insertion of the first customer. MAYBE that's o.k. since the 'Oracle Database Change Notification documentation' specifies that Associating a Query with a Registration "is a one-time process". What could be a problem is that the insertion of the customer does not log any DCN events that I can see. The documentation indicates that a listener should have been set up to 'Notifying Database Change Events'. I'm assuming that the persistence code uses the example code or similar to that in the documentation link so I'm considering downloading the source and having a look. Any feedback as to if I'm on the right track here would be most appreciated.

I suppose perhaps this is obvious but I guess either the DatabaseChangeEvent isn't being fired by the insert or the DatabaseChangeListener isn't set up correctly to receive it.

I see some places where the eventManager is null in UnitOfWorkImpl.commitAndResume and I'm not sure if that is supposed to be instantiated or not...

[Updated on: Mon, 26 November 2012 19:45]

Report message to a moderator

Re: Error on Test #2 JPA/DCN Example Code [message #987693 is a reply to message #987450] Tue, 27 November 2012 16:10 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I don't see anything unexpected in the log. The only guesses I have are,

1 - you are somehow dropping-replacing the tables after registering for them. I don't see this in the log, but can you start the example with the tables already created (don't drop the schema).

2 - the change events from the database are either not getting through, or very slow to get through. Try increasing the sleep time in the example. Also try a basic JDBC test of your database to see if DCN is working.



James : Wiki : Book : Blog : Twitter
Re: Error on Test #2 JPA/DCN Example Code [message #987700 is a reply to message #909052] Tue, 27 November 2012 16:26 Go to previous messageGo to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Hello. Since I can debug into the code (please see attached), I'd like to know where specifically in the code I should/could see an event coming in from the database. It appears the listeners are being registered (also attached).

Is it in UnitOfWorkImpl.commitAndResume?

When/where should I see the change notification? Does the cache get updated?

Re: Error on Test #2 JPA/DCN Example Code [message #988224 is a reply to message #987693] Wed, 28 November 2012 22:36 Go to previous message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
SUCCESS! For the most part...

Trying the simpler example was a splendid idea. The DBChangeNotification.java example from the link (same one is on Oracle web-site) showed me that indeed things were being set up properly but that the code waited and waited for the listener to be notified of db events, which ultimately never came. After Googling and seeing something about a firewall I got to thinking about the setup on which I was running. To make a long story short, I ran the DBChangeNotification example and then subsequently the JPA/DCN example on one of our Linux machines and was immediately successful. I am however, still facing the problems discussed above when running on my PC. No matter! At least I now know where the issue is and can design my application to use the JPA DCN! I just need to work with the IT folks to let the Oracle server talk to the PC application. Thank goodness.

When I get it resolved I'll post my solution in the event it will help someone else.
Previous Topic:newbie: Native SQL Query
Next Topic:Temporal Type in Dynamic JPA
Goto Forum:
  


Current Time: Thu Apr 18 17:26:10 GMT 2024

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

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

Back to the top