[jira] [Updated] (ISIS-2029) Using Application Identity (e.g. settings module) with .orm file leads to Webui exception

2018-11-03 Thread Vladimir Nisevic (JIRA)


 [ 
https://issues.apache.org/jira/browse/ISIS-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vladimir Nisevic updated ISIS-2029:
---
Attachment: stacktrace.txt

> Using Application Identity (e.g. settings module) with .orm file leads to 
> Webui exception
> -
>
> Key: ISIS-2029
> URL: https://issues.apache.org/jira/browse/ISIS-2029
> Project: Isis
>  Issue Type: Bug
>  Components: Core, Core: Viewer: Wicket
>Affects Versions: 1.16.2
>Reporter: Vladimir Nisevic
>Priority: Major
> Attachments: stacktrace.txt
>
>
> h2.Problem description
> I want to use settings module (incode or previous isis-addons) so that the 
> tables are persisted in custom database schema (different than isissettings).
> In order to achieve this I have created a custom .orm file e.g.
>  
> package-custom.orm 
> {code:java}
> 
> http://xmlns.jcp.org/xml/ns/jdo/orm;
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/orm 
> http://xmlns.jcp.org/xml/ns/jdo/orm_3_0.xsd;>
> 
>  table="IsisAppSetting"/>
> 
> 
> 
> {code}
> and refer the file in persistor_datanucleus.properties
> {code:java}
> # schema name override
> isis.persistor.datanucleus.impl.datanucleus.Mapping=custom{code}
>  
> I can create single ApplicationSetting thru WebUI but if I have more than one 
> persisted, here the WebUI exception I get in WebUI
> {code:java}
> Caused by:
> org.datanucleus.exceptions.NucleusUserException
> Identity 
> "interface.MQTT.activated[OID]org.incode.example.settings.dom.jdo.ApplicationSettingJdo"
>  is assigned to class 
> "org.incode.example.settings.dom.jdo.ApplicationSettingJdo", but its not the 
> correct object-id type for this class.
> org.datanucleus.store.AbstractStoreManager#manageClassForIdentity(AbstractStoreManager.java:937)
> org.datanucleus.ExecutionContextImpl#getClassDetailsForId(ExecutionContextImpl.java:3385)
> org.datanucleus.ExecutionContextImpl#findObjects(ExecutionContextImpl.java:3251){code}
>  
> I believe the root cause is that Datanucleus thinks somehow that the 
> ApplicationSetting has not Application Identity which it has since field key 
> is primary key - but only in the case when retreiving more then one entity 
> from database.
>  
> All works fine when creating new instance ApplicationSetting or reading it 
> from database by key. The command "Settings --> listAll" fails.
>  
> I tried also to adapt the .orm file e.g. but it didn't helped.
> {code:java}
> 
>  schema="myschema" table="IsisAppSetting">
> 
> 
>  table="IsisUserSetting"/>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ISIS-2029) Using Application Identity (e.g. settings module) with .orm file leads to Webui exception

2018-11-03 Thread Vladimir Nisevic (JIRA)
Vladimir Nisevic created ISIS-2029:
--

 Summary: Using Application Identity (e.g. settings module) with 
.orm file leads to Webui exception
 Key: ISIS-2029
 URL: https://issues.apache.org/jira/browse/ISIS-2029
 Project: Isis
  Issue Type: Bug
  Components: Core, Core: Viewer: Wicket
Affects Versions: 1.16.2
Reporter: Vladimir Nisevic


h2.Problem description

I want to use settings module (incode or previous isis-addons) so that the 
tables are persisted in custom database schema (different than isissettings).

In order to achieve this I have created a custom .orm file e.g.

 

package-custom.orm 
{code:java}

http://xmlns.jcp.org/xml/ns/jdo/orm;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/orm 
http://xmlns.jcp.org/xml/ns/jdo/orm_3_0.xsd;>







{code}
and refer the file in persistor_datanucleus.properties
{code:java}
# schema name override
isis.persistor.datanucleus.impl.datanucleus.Mapping=custom{code}
 

I can create single ApplicationSetting thru WebUI but if I have more than one 
persisted, here the WebUI exception I get in WebUI
{code:java}
Caused by:
org.datanucleus.exceptions.NucleusUserException
Identity 
"interface.MQTT.activated[OID]org.incode.example.settings.dom.jdo.ApplicationSettingJdo"
 is assigned to class 
"org.incode.example.settings.dom.jdo.ApplicationSettingJdo", but its not the 
correct object-id type for this class.
org.datanucleus.store.AbstractStoreManager#manageClassForIdentity(AbstractStoreManager.java:937)
org.datanucleus.ExecutionContextImpl#getClassDetailsForId(ExecutionContextImpl.java:3385)
org.datanucleus.ExecutionContextImpl#findObjects(ExecutionContextImpl.java:3251){code}
 

I believe the root cause is that Datanucleus thinks somehow that the 
ApplicationSetting has not Application Identity which it has since field key is 
primary key - but only in the case when retreiving more then one entity from 
database.

 

All works fine when creating new instance ApplicationSetting or reading it from 
database by key. The command "Settings --> listAll" fails.

 

I tried also to adapt the .orm file e.g. but it didn't helped.
{code:java}





{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)