Giter VIP home page Giter VIP logo

datanucleus-api-jdo's People

Contributors

andyjefferson avatar belugabehr avatar kraendavid avatar mboapache avatar renataogarcia avatar ukeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

datanucleus-api-jdo's Issues

Support java.time types in JDO Typesafe

Could add LocalTimeExpression, LocalDateExpression, LocalDateTimeExpression to accepted expressions and then update datanucleus-jdo-query to add these to the Q classes.

Report use of @Column or @Element on a Collection

Feature Request:

Add a check for situations where @column or @element is used on then Many side of a relation (Datatype List) causing only the first ID of Many relation is stored.

@javax.jdo.annotations.PersistenceCapable @javax.jdo.annotations.Inheritance(strategy = InheritanceStrategy.NEW_TABLE) .... public abstract class Step { @Column(name = "toBeFinished", allowsNull = "true") private List<Step> stepsToBeFinished = Lists.newArrayList();

Was generated with a column in the table but only the ID of the first element was stored. Instead I would have expected an error about this situation.

Support core-156

The JDO spec has various rules about the ObjectIdClass, and one of these is that all fields should be present in the PersistenceCapable class. With our "targetClassName" extension this is not present, so we need to avoid this check for that field name

Add option of having a Query/Extent that is really closed when calling close()

The JDO 3.2 spec has a close method but all that it mandates is that it calls closeAll releasing all results. It would make more sense to have it release all resources and connections to other objects (PM, underlying query etc). We need this to be configurable to make it compliant whilst still allowing the option of sensible behaviour

Implement JDO 3.2 Metadata API additions

See ElementMetadataImpl, KeyMetadataImpl, ValueMetadataImpl, MemberMetadataImpl.

We now have MetaDataManager available on internalMD so possible to do these now.

Unable to call stored procedure following http://www.datanucleus.org/products/datanucleus/jdo/stored_procedures.html

Hi,

I am following recipe described here:

http://www.datanucleus.org/products/datanucleus/jdo/stored_procedures.html

I need to call stored procedure. I used postgresql RDBMS

The code snippet:

        PersistenceManager pm = pmf.getPersistenceManager();

        Transaction tx = pm.currentTransaction();

        try {

            tx.begin();

            Query query = pm.newQuery("STOREDPROC","foo");

            query.execute();

            tx.commit();

        } finally {

            try {

                rollbackIfActive(tx);

            } finally {

                pm.close();

            }

        }

results in stack:

javax.jdo.JDODataStoreException: Error encountered when extracting results for SQL query "foo"
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:543) ~[datanucleus-api-jdo-4.1.1.
jar:na]
at org.datanucleus.api.jdo.JDOQuery.execute(JDOQuery.java:242) ~[datanucleus-api-jdo-4.1.1.jar:na]
at org.dcache.services.billing.db.impl.datanucleus.DataNucleusBillingInfo.executeStoredProcedure(DataNucleusBillingInfo.java:275) ~[dc
ache-core-2.17.0-SNAPSHOT.jar:2.17.0-SNAPSHOT]
at org.dcache.services.billing.db.impl.datanucleus.DataNucleusBillingInfo.aggregateDaily(DataNucleusBillingInfo.java:263) ~[dcache-cor
e-2.17.0-SNAPSHOT.jar:2.17.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_25]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "CALL"
postgresql log says:

2016-06-01 14:03:59.794 CDTERROR:  syntax error at or near "CALL" at character 1
2016-06-01 14:03:59.794 CDTSTATEMENT:  CALL foo()

postgresql does not support CALL to invoke procedures, it uses select.

I understand that I could do something like

Query query = pm.newQuery("javax.jdo.query.SQL","SELECT foo()");

but then it won't work with Oracle for instance. Help?

Close of JDOQLTypedQuery usually NullPointerExceptions

Found in 5.0.1:

The JDOQLTypedQueryImpl.close() routine throws a NullPointerException on every call unless you happen to call getFetchPlan(), as only getFetchPlan() initializes the fetchPlan variable, but the close() routine assumes it's always non-null.

Once fixed, should allow the following auto-close to work properly:

try (JDOQLTypedQuery<SomeClass> tq = manager.newJDOQLTypedQuery(SomeClass.class)) {
    // work            
}

Change default to use optimistic transactions

JDO (in DataNucleus) has always defaulted to pessimistic transactions (though by default NOT locking objects). This originated in not supporting optimistic transactions back in the early JPOX days. JPA defaults to optimistic, and makes sense to to do the same for JDO.

Still got various tests that show side issues with moving to optimistic as default, so postponing

If a user has a PK class using javax.jdo.XXXIdentity as part of a compound id, this fails on enhancement

Since we use the DN-internal single field id PK classes now, this is failing a check at
org.datanucleus.metadata.AbstractClassMetaData.validateObjectIdClass

The simple workaround is to specify DN-specific PK fields, or provide an objectIdClass for the object that makes up the PK.

The stack trace with v4.0.3 is as follows

Class "mydomain.model.CompoundTarget" has been specified with an object-id class mydomain.model.CompoundTarget$Id which has a field source. The field mydomain.model.CompoundTarget$Id.source has type javax.jdo.identity.LongIdentity but should be org.datanucleus.identity.LongId. All non static fields of an objectId class must include the names of the primary key fields in the JDO class, and the types of the corresponding fields must be identical.
org.datanucleus.metadata.InvalidPrimaryKeyException: Class "mydomain.model.CompoundTarget" has been specified with an object-id class mydomain.model.CompoundTarget$Id which has a field source. The field mydomain.model.CompoundTarget$Id.source has type javax.jdo.identity.LongIdentity but should be org.datanucleus.identity.LongId. All non static fields of an objectId class must include the names of the primary key fields in the JDO class, and the types of the corresponding fields must be identical.
at org.datanucleus.api.jdo.JDOAdapter.processPrimaryKeyClass(JDOAdapter.java:551)
at org.datanucleus.api.jdo.JDOAdapter.isValidPrimaryKeyClass(JDOAdapter.java:464)
at org.datanucleus.metadata.AbstractClassMetaData.validateObjectIdClass(AbstractClassMetaData.java:1442)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.