by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Ivan
    @advancedwebdeveloper
    can anyone tell about options for a commercial support?
    is there are any success stories, which could be presented with a customer?
    Ivan
    @advancedwebdeveloper
    @andyjefferson , anyone from your team would desire to speak on March 29 or March 30?
    Ivan
    @advancedwebdeveloper
    I also wonder if your company might speak about doing business on a commercial support of software libs - there is http://thinkstage.com.ua/en/
    Andy Jefferson
    @andyjefferson
    @advancedwebdeveloper Thanks for the invite. I don't do conferences and speaking, and prefer to concentrate on the software itself. Hope both go well.
    aley2003
    @aley2003
    There was a commit in datanucleus-api-jdo at 23 Nov 2018 which "adds hashCode for completeness" to JDOPersistenceManagerFactory. The added hashCode() does not obey the rules for hashCode() and equals() because equals() checks for identity and hashCode() delivers the properties based hashCode of Configuration. The spring framework uses JDOPersistenceManagerFactory as key for a Map. This ist broken with the new JDOPersistenceManagerFactory and Spring throws an IllegalStateException.
    I think the new JDOPersistenceManagerFactory.hashCode() and also the equals() functions and should be removed completely.
    Andy Jefferson
    @andyjefferson
    Deleting equals and hashCode isn't going to happen. If you want to CONTRIBUTE an implementation of such methods then you are, of course, free to do so.
    aley2003
    @aley2003
    JDOPersistenceManagerFactory.equals() does the same as Object.equal(), check for identity. So hashCode() has to deliver identical hashCodes for identical Objects. This is also implemented in Object.hashCode(). I see two solutions: remove both functions from JDOPersistenceManagerFactory or copy both functions from Object to JDOPersistenceManagerFactory. I have tested the first solution and it works.
    Dan Haywood
    @danhaywood
    @andyjefferson - I think that datanucleus.org is down
    Dan Haywood
    @danhaywood
    back up now
    ah, no, that was a page in my browser's cache
    Andy Jefferson
    @andyjefferson
    @danhaywood Should be back now.
    RCG
    @rebecacortazar
    Hi, I am new to this and this is a silly question, but do Datanucleus libraries support Java 12 ? If not, any idea of the expected release date? Any help will be very much welcome, thank you.
    Andy Jefferson
    @andyjefferson
    @rebecacortazar Not a silly question. Simple answer is I've no idea since I'm using Java 8 (what I develop DataNucleus with). The codebase certainly includes ASM v7 and so supports Java 11 bytecode (see datanucleus/datanucleus-core#314 ). Whether that is enough for Java 12 would be for someone to actually try.
    RCG
    @rebecacortazar
    Hi there! Thanks for being so swift. I have the answer: no, it does not work, Java 12 is not supported.
    Andy Jefferson
    @andyjefferson
    @rebecacortazar, Perhaps you can provide a more informative statement than 'it does not work', like what error you get doing what. Better still you get the code and contribute whatever update is needed to get it to work (e.g use latest ASM? See the repackaged ASM in datanucleus-core)
    Norbert Bartels
    @nbartels
    hi all, I'm migrating to DN 5.1.2 atm and found a strange problem. We have objects in the DB with a java.util.Date field. In older versions (we are coming from 4.1) the field is populated with a plain java.util.Date object and in 5.1.2 it is a org.datanucleus.store.types.wrappers.Date object. It looks like the getValue is not used on the wrapper somewhere in the code. Other objects (at least the ones we use) are okay so far. Is this change intended and we have to adapt to it?
    Andy Jefferson
    @andyjefferson
    A database holds a DATE or DATETIME column (assuming you have an RDBMS database). You havent defined WHERE you get these java types from (what operation etc). What is "intended" is what is in the test suites. No way of knowing whether your situation is covered by the test suites, but that's why people have been advised since 16 yrs ago to contribute. Oh, and v5.2 is the latest, so don't get the idea of moving to 5.1
    RCG
    @rebecacortazar
    @andyjefferson Sorry for my late response and my apologies. I cannot replicate what I did, but I remember that the problem was related to version compilation mismatches (version 56). In any case, my code is running perfectly well in Java 12. Sorry for the inconvenience.
    Norbert Bartels
    @nbartels
    @andyjefferson you can simply check the test here https://github.com/nbartels/test-jdo/tree/date-test it should explain everything
    Andy Jefferson
    @andyjefferson
    @nbartels You mean to say "I access a Date field of a persistable object WITHIN A TRANSACTION after retrieving it via getObjectById, and it is of a wrapper type". Yes how else would a JDO provider be able to intercept mutating methods on that field if it didn't replace with a wrapper that extends the DEFINED type? What it did in 4.x I've little interest in. If you don't intend on mutating that field then choose a SCO type that doesn't need a "proxy" as per http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/mapping.html#_temporal_types_java_util_java_sql_java_time_jodatime
    Alex Ilyin
    @engilyin

    @andyjefferson is there any plans to integrate DataNucleus with Micronaut Data (https://github.com/micronaut-projects/micronaut-data) other name Predator. You can read about https://objectcomputing.com/news/2019/07/18/unleashing-predator-precomputed-data-repositories

    Micronaut is a new good replacement for de-facto standard in the current Java world Spring Boot. Micronaut is similar to Spring but it completely eliminates reflection, runtime proxies, and dynamic classloading. So you can get significant performance gains, small footprint and startup time.
    Especially it is very interested with GraalVM Substrate native images to build efficient native cloud microservices and even FaaS.

    Currently they support just JDBC and JPA based on Hibernate. And of course due to the proxy nature of Hibernate they could not get all benefits of AoT on their platform when using JPA.

    I believe that is so exited opportunity for DataNucleus which is using compile time code enhancements instead of proxy and reflection API to become the primary JPA solution for Micronaut.

    Andy Jefferson
    @andyjefferson
    @engilyin No plans. Not something I'm interested in. Besides, any work for "integrating" would go on their side, not ours. Same would apply for "integrating" with Spring Data. DN provides / supports published APIs so it would be for third party software (Spring, Micronaut, etc) to use those. If they find that they need access to other DataNucleus info then they can request addition of DN internal APIs and I could add those. But this would be down to somebody who actually wants that integration to do the work.
    Alex Ilyin
    @engilyin
    Thank you Andy!
    Thirumurthi S
    @thirumurthis
    Hi All,
    I am working on an application which uses JDO and DataNucleus to query the Oracle database. The application was developed using Datanucleus 2.1.0 and now i am using 5.2.1, the application is fetching the data for most of the cases.
    There was one specific mapping which i am seeing "Exception in thread "main" java.lang.NoSuchMethodError: com.package.dao.car.dnSetValue" where the Java/Pojo mapping has package.jdo defeined for a table and corresponding java class extends
    another class which has defeined the field name. The enchancer successfully executed. https://stackoverflow.com/questions/58273407/jdo-table-mapping-to-pojo-with-no-annotation-and-extending-a-class-for-proper
    Andy Jefferson
    @andyjefferson
    @thirumurthis If the enhancer successfully executed then you can easily decompile the classes and inspect them for methods etc, as per http://www.datanucleus.org:15080/products/accessplatform_5_2/jdo/enhancer.html#_decompilation This would reveal whether it did indeed ... as would the log which tells you about addition of methods and fields to classes during the enhancement process
    Thirumurthi S
    @thirumurthis

    @andyjefferson I decompiled the class with 'javap -c', I could see the getValue and setValue method.
    Also the notice the comments for dnGet/Set as well
    30: invokevirtual #408 // Method dnGetValue:()Ljava/lang/String;
    33: invokevirtual #390 // Method dnSetValue:(Ljava/lang/String;)V

    Debugged and noticed the AbstractClassMetaData.class, getManagedMembers () returns 2 FieldMetadata and 1 PropertiesMetaData (corresponds to the field tagged using <property> tag in jdo) for this case.
    could there be any difference in using the Field and Properties in jdo mapping with respect to latest version of datanucleus.

    Andy Jefferson
    @andyjefferson
    @thirumurthis I personally use just field, always. Others use just properties. We have some tests with mixed, and all work (though nobody has ever convinced me of the point of doing that). What happened in some ancient version is of little interest because nobody here will look at old versions, far better to concentrate your time looking at WHY. The only time I'd see any possible problem is when a getter or a setter is missing ... i.e only one specified at some inheritance level. A runtime NoSuchMethod together with the decompiled classes should be enough to tell you what class is missing what.
    Andy Jefferson
    @andyjefferson
    Or maybe you have this situation ... datanucleus/datanucleus-core#257 If so, you just provide the other method and relay it to the superclass (or contribute a fix to the DN code ... as the issue says).
    Thirumurthi S
    @thirumurthis
    i think i found the root cause of my issue, the older DataNucleus-enhancer expects the getter/setter as jdoGetXXX/ jdoSetXXX which in newer version it should be dnGet/dnSet. The decompiler input helped since i compared the older and newer one locally. now it is working in my case. @andyjefferson Appreciate your help/support/time. Thank you.
    M W
    @ePortfel_gitlab
    I have a question. My JPA object has obj.dnStateManager.dirty=false and obj.dnStateManager.myLC.isDirty=true. In that case: is it dirty or not? And I also would propose to add the function NucleusJPAHelper.isDirty(obj) - it would be helpful, especially for debugging purposes.
    M W
    @ePortfel_gitlab
    My problem is that I have dirty object and in the same transaction I try to read different, unrelated object from database by JPAQuery.getResultList(). It flushes the dirty object and goes to StateManagerImpl.flush(). On StateManagerImpl:5844 it invokes clearDirtyFlags(). This function clears obj.dnStateManager.dirty and obj.dnStateManager.dirtyFields[] but does not touch obj.dnStateManager.myLC so obj.myPC.dnIsDirty() returns true which might be wrong cause the object is clean. As I am not sure what is going on here, is there something i miss?
    M W
    @ePortfel_gitlab
    Ok, I am learning so try to answer myself: obj.dnStateManager.dirty=false means all fields in obj are updated in database, but it does not mean that lifecycle od obj is not DIRTY. obj.dnStateManager.myLC.isDirty shows if the lifecycle state of obj is DIRTY which is another thing. So it is not inconsistent to have different values in the fields. But it is inconsistent if obj.dnStateManager.dirty=true and obj.dnStateManager.dirtyFields[] is false for every field. And that is the state I got.
    Andy Jefferson
    @andyjefferson
    If you want some function added then get the code and provide a Pull Request, simple. If you get some fields and overall object in some (strange) state, then define HOW by way of a reproduceable test. Obviously you also need to check on whether any surrogate fields are not dirty for that state to be considered strange.
    M W
    @ePortfel_gitlab
    So, there is the source of my problem. I have taken obj that is persistent and transactional. It has no dirty fields. And I invoked obj=entityManager.merge(obj). As the object is persistent and current values are in database I believe merge function should do nothing and give back reference to obj. But instead it goes like this: at org.datanucleus.state.StateManagerImpl.makePersistent(StateManagerImpl.java:4519) at org.datanucleus.ExecutionContextImpl.persistObjectInternal(ExecutionContextImpl.java:2085) at org.datanucleus.ExecutionContextImpl.persistObjectWork(ExecutionContextImpl.java:1869) at org.datanucleus.ExecutionContextImpl.persistObject(ExecutionContextImpl.java:1724) at org.datanucleus.api.jpa.JPAEntityManager.merge(JPAEntityManager.java:695) and on StateManagerImpl.java:4519 it makes obj.dnStateManager.dirty=true which seems to be wrong as no fields are dirty.
    Juan Cruz Gardey
    @juancruzgardey
    Hi everyone! I'm following the example presented in the documentation (that with inventories and products) and I observed that the query "SELECT this.name FROM mydomain.Product WHERE inv.products.contains(this) AND inv.name == 'Sale' VARIABLES mydomain.Inventory inv" does not work in mongo and Cassandra (it returns an empty collection) but it does in a mysql database. It seems that some datastores don't allow to filter by a field of a variable. Am I right? in that case, how do you solve that kind of queries? Thanks in advance!
    Andy Jefferson
    @andyjefferson
    Correct. For Cassandra, generation of a CQL query from JDOQL/JPQL is done in https://github.com/datanucleus/datanucleus-cassandra/blob/master/src/main/java/org/datanucleus/store/cassandra/query/QueryToCQLMapper.java and the method processVariableExpression() is not implemented. For MongoDB, generation of a Mongo query from JDOQL/JPQL is performed by https://github.com/datanucleus/datanucleus-mongodb/blob/master/src/main/java/org/datanucleus/store/mongodb/query/QueryToMongoDBMapper.java and the method processVariable() is not implemented. Being open source, people could contribute to the code, since that is why we made it public ...
    The log will always display what query is invoked (if the datastore supports a text-based query, such as CQL). So you can see what is being tried. If you think you can come up with a valid CQL, you could always put that in directly, and start an issue on how to support a specific variable for a particular datastore.
    Juan Cruz Gardey
    @juancruzgardey
    I have configured two persistence manager factories, one with mysql and the other one with xml. I'm trying to migrate the data from the mysql database to the xml by persisting the root object of my model but as a result I get a lot of "[Fatal Error] database.xml:3:1: Premature end of file." even when I have database.xml initialised, and at the end the file is empty (only with the xml header). The weird thing is that during the execution, I can see that some objects are being persisted in the file but then they are completely removed. Is it something related to cascade persisting? in my pom.xml, in addition to the dataNucleus-xml, jaxb-api and jaxb-impl jars I had to include also jaxb-core due to a missing class. Thanks!
    Juan Cruz Gardey
    @juancruzgardey
    I understand that the object that I'm trying to persist is transient because although I use detachCopy to decouple it from the source repository, it isn't detachable
    Andy Jefferson
    @andyjefferson
    If you have an object that you are trying to PERSIST into an XML datastore then why not just focus on that one operation ... create a transient object and pass it to makePersistent for the XML PersistenceManager? (and cut out the MySQL database for now).
    Juan Cruz Gardey
    @juancruzgardey
    @andyjefferson I also tried to persist a created object but when I use makePersistent on a new object that has associated another transient object, I get "java.lang.NullPointerException at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.getIdValue" which I don't understand because I'm using application-identity ids with "uuid-hex" strategy. The persistence works well when I call makePersistent for the two objects separately.
    Andy Jefferson
    @andyjefferson
    @juancruzgardey Which is where you get the code for the XML plugin and debug it / extend it. That plugin was written a long time ago by someone else. Maybe they didnt provide support for all situations ...
    Andy Jefferson
    @andyjefferson
    For example, if your problem is relation persistence when using value generators on the related object, then maybe you need to ensure the id of the related object is set BEFORE the call to marshall(). Look at the other "store" plugins for what they do.
    Andy Jefferson
    @andyjefferson
    Juan Cruz Gardey
    @juancruzgardey
    Thanks @andyjefferson