Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Data Partitioning Help

Hi 

I am using Eclipselink 2.5.2 and having the same issue. I am getting the
error message of "javax.persistence.RollbackException:
java.lang.NullPointerException". 

here is the second node in persistence.xml I used:

            
            <property name="eclipselink.connection-pool.node2.url"
value="jdbc:oracle:thin:@localhost:1521:cusNode1" />
            <property name="eclipselink.connection-pool.node2.user"
value="root" />
            <property name="eclipselink.connection-pool.node2.password"
value="root" />
            <property name="eclipselink.connection-pool.node2.initial"
value="1" />
            <property name="eclipselink.connection-pool.node2.min"
value="64" />
            <property name="eclipselink.connection-pool.node2.max"
value="64" /> 

Could anyone help me with this issue?
 
Another questions: How can I configure more than 2 database connection pool?
Just to repeat the configuration for the 2nd database connection pool? 



Attila-3 wrote
> Hello Everyone,
> 
> I am new to EclipseLink and have a couple of questions regarding
> Partitioning policies.
> 
> I followed the example at:
> 
> http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Data_Partitioning
> 
> I annotated my entity with the HashPartitioning policy but I am unable to
> get any entities to be persisted to the 'node2' connection pool.
> 
> Here is my persistence.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";>
>   
> <persistence-unit name="MServicePU" transaction-type="RESOURCE_LOCAL">
>     
> <class>
> com.e.m.persistence.Conv
> </class>
>     
> <properties>
>       
> <property name="javax.persistence.jdbc.driver"
> value="com.mysql.jdbc.Driver"/>
>       
> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://
> server-dev-db.example.com:3306/t_c_db_1"/>
>       
> <property name="javax.persistence.jdbc.user" value="root"/>
>       
> <property name="javax.persistence.jdbc.password" value="pass"/>
>       

>       

>       

>       
> <property name="eclipselink.connection-pool.default.initial"
> value="10"/>
>       
> <property name="eclipselink.connection-pool.default.min" value="64"/>
>       
> <property name="eclipselink.connection-pool.default.max" value="64"/>
>       

>       
> <property name="eclipselink.connection-pool.node2.url"
> value="jdbc:mysql://server-dev-db.example.com:3306/t_c_db_2"/>
>       
> <property name="eclipselink.connection-pool.node2.user" value="root"/>
>       
> <property name="eclipselink.connection-pool.node2.password"
> value="pass"/>
>       
> <property name="eclipselink.connection-pool.node2.initial"
> value="10"/>
>       
> <property name="eclipselink.connection-pool.node2.min" value="64"/>
>       
> <property name="eclipselink.connection-pool.node2.max" value="64"/>
>       
> <property name="eclipselink.connection-pool.node2.initial"
> value="10"/>
>       
> <property name="eclipselink.connection-pool.node2.min" value="64"/>
>       
> <property name="eclipselink.connection-pool.node2.max" value="64"/>
>       
> <property name="eclipselink.partitioning" value="Replicate" />
>     
> </properties>
>   
> </persistence-unit>
> </persistence>
> Some questions I have are:
> 
> Will HashPartitioning scale to 10+ shards? (Where I have millions of
> records
> in each shard that will be heavily loaded with 50/50 read/writes)
> 
> Would I be able to use the PartitioningPolicy to define my own policy that
> does a lookup in memcache for what shard to route requests to? If it is
> not
> present in memcache then I would need to scan all shards to find the
> entities ID, then populate memcache -- to then finally return the shard
> connection pool. Does this sound like it would work reasonably well?
> 
> Are there more examples/documentation that I could look at?
> 
> Thank you,
> 
> -- 
> Atman
> Software Developer
> atteeela@xxxxxxxxx
> 
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users






--
View this message in context: http://eclipse.1072660.n5.nabble.com/Data-Partitioning-Help-tp534p173972.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.


Back to the top