Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Custom Partitioning Policy

The issue seems to be that the connectionPools for your custom policy are
empty, so there is no connect for any query, causing the null-pointer.  You
need to give your custom policy a set of connection pools to hash from.

The reason the Hash policy does not get this error is that if its pools are
empty, it sets them to all of the pools defined in the session on
initialize.

The reason initialize is not called in your case is that the
CustomPartitioningPolicy is not forwarding the method.  It should, so please
log a bug, also include the null-pointer in the bug, as no connections
should not trigger a null-pointer, its should only return no data.


Michael Pflueger wrote:
> 
> Right, i didn't get a stack trace at first, but that was because it got
> hidden by my threadpool.
> The stacktrace is:
> 
> Exception in thread "main" java.lang.NullPointerException
> 	at
> org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:435)
> 	at
> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1081)
> 	at
> org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:844)
> 	at
> org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
> 	at
> org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:392)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2844)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1519)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1501)
> 	at
> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1126)
> 	at
> org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1519)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1501)
> 	at
> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1466)
> 	at
> org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:485)
> 	at
> org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:742)
> 
> The version of eclipselink used is a 2.3.1 nightly from about 2 months
> ago, btw.
> 
> 
> Michael
> 
> -----Ursprüngliche Nachricht-----
> Von: eclipselink-users-bounces@xxxxxxxxxxx
> [mailto:eclipselink-users-bounces@xxxxxxxxxxx] Im Auftrag von James
> Sutherland
> Gesendet: Mittwoch, 9. November 2011 17:06
> An: eclipselink-users@xxxxxxxxxxx
> Betreff: Re: [eclipselink-users] Custom Partitioning Policy
> 
> 
> Please include the stack trace.
> ___________________________________________________
> 
> SMA Solar Technology AG
> Aufsichtsrat: Guenther Cramer (Vorsitzender)
> Vorstand: Juergen Dolle, Roland Grebe, Uwe Hertel, Pierre-Pascal Urbon,
> Marko Werner
> Handelsregister: Amtsgericht Kassel HRB 3972
> Sitz der Gesellschaft: 34266 Niestetal
> USt-ID-Nr. DE 113 08 59 54
> WEEE-Reg.-Nr. DE 95881150
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Custom-Partitioning-Policy-tp32804681p32856555.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top