Thursday, April 20, 2017

cURL simple load script

 curl -X PUT  -d@test.xml http://ppp.amazonaws.com/p[1-2000].xml &
pidlist="$pidlist $!" 
curl -X PUT  -d@a.xml http://qqq.amazonaws.com/q[1-2000].xml &
pidlist="$pidlist $!" 
 curl -X PUT  -d@b.xml http://rrr.amazonaws.com/r[1-2000].xml &
pidlist="$pidlist $!" 
curl -X PUT  -d@c.xml http://sss.amazonaws.com/s[1-2000].xml &
pidlist="$pidlist $!" 
 

for job in $pidlist do 
  echo $job     
  wait $job || let "FAIL+=1" 
done  

if [ "$FAIL" == "0" ]; then 
  echo "SUCCESS!" 
else 
  echo "FAIL! ($FAIL)" 
fi


Monday, September 12, 2016

Enabling 2nd level caching in Hibernate/Wildfly

Standalone.xml


User has to provide the hibernate-infinispan library version in the cache-container configuration.



<cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan:5.2.1.Final">
                <local-cache name="entity">
                    <transaction mode="NON_XA"/>
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="local-query">
                    <eviction strategy="LRU" max-entries="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="timestamps"/>
            </cache-container>


Persistance.xml


 <persistence-unit name="apidb-persistence-unit"
            transaction-type="JTA">
            <description>Forge Persistence Unit</description>
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:jboss/datasources/lobDS</jta-data-source>     
            <shared-cache-mode>ALL</shared-cache-mode>
    <properties>
      <property name="hibernate.cache.use_second_level_cache" value="true"/>     </properties>
        </persistence-unit>