Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In federated env. LDAPMetaDataListener raises an exception about IdentityType.DATASTORE for the classes in another RDBMS data store #11

Open
rezarahimi opened this issue May 12, 2016 · 3 comments

Comments

@rezarahimi
Copy link

I have a federated environment which contains multiple RDBMS and a LDAP data stores, when I want to load the application I got the InvalidClassMetaDataException for the classes which belong to another RDBMS store.

@andyjefferson
Copy link
Member

All issues need testcases so that they are reproducible. The only exception to that is where people are going to develop fixes themselves, that don't break other features

@rezarahimi
Copy link
Author

I have commented it with following patch for my self because I care my self that do not use IdentityType.DATASTORE for my PersistenceCapable LDAP classes:

--- a/src/main/java/org/datanucleus/store/ldap/LDAPMetaDataListener.java
+++ b/src/main/java/org/datanucleus/store/ldap/LDAPMetaDataListener.java
@@ -33,10 +33,10 @@ public class LDAPMetaDataListener implements MetaDataListener
      */
     public void loaded(AbstractClassMetaData cmd)
     {
-        if (cmd.getIdentityType() == IdentityType.DATASTORE && !cmd.isEmbeddedOnly())
+ /*       if (cmd.getIdentityType() == IdentityType.DATASTORE && !cmd.isEmbeddedOnly())
         {
             // Datastore id not supported
             throw new InvalidClassMetaDataException("LDAP.DatastoreID", cmd.getFullClassName());
-        }
+        }*/
     }

and my test environment is inside Apache ISIS and I don't know when I can create a suitable separate test case for it(I will try to do it but I am not sure when) but it is clear that checking all the AbstractClassMetaData classes with identityType of IdentityType.DATASTORE without any guards includes all classes of all stores and the RDBMS ones too.
I had to fix some other bugs in datanucleus-core and datanucleus-rdbms too for running my Apache ISIS application which need really a test case.

@andyjefferson
Copy link
Member

Thanks, but clearly commenting out functionality is not an option.
What would be an option is for you to provide a persistence property that is applied at the store level (StoreManager) that disables metadata checks (default to have them enabled). So then you can disable via a persistence property for particular stores used by DataFederation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants