Hikari Connection Pool

DataSource Configuration in Java:

HikariConfig config = new HikariConfig();
config.setDriverClassName(“org.postgresql.Driver”);
config.setJdbcUrl(postgresqlConfig.getUrl());
config.setUsername(postgresqlConfig.getUser());
config.setPassword(postgresqlConfig.getPassword());
config.setMinimumIdle(postgresqlConfig.getMaxIdle());
config.setMaximumPoolSize(postgresqlConfig.getMaxActive());
config.addDataSourceProperty(“cachePrepStmts”, “true”);
config.addDataSourceProperty(“prepStmtCacheSize”, “250”);
config.addDataSourceProperty(“prepStmtCacheSqlLimit”, “2048”);
return new HikariDataSource(config);

gradle dependency:

compile ‘com.zaxxer:HikariCP:2.4.1’

Quick Links: Hibernate / JPA Testing Strategies

http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/

http://damnhandy.com/2008/08/20/hibernate-and-and-the-found-two-representations-of-same-collection-error/

http://www.infoq.com/articles/testing-in-spring

https://github.com/michaelyaakoby/testfun

http://www.oracle.com/technetwork/articles/java/unittesting-455385.html

http://webcache.googleusercontent.com/search?q=cache:ZXg8qoRBYcMJ:struberg.wordpress.com/2012/03/27/unit-testing-strategies-for-cdi-based-projects/+&cd=1&hl=en&ct=clnk&gl=us

https://github.com/struberg/lightweightEE/blob/master/backend/src/test/java/de/jaxenter/eesummit/caroline/backend/test/CdiContainerTest.java

http://blog.novatec-gmbh.de/unit-testing-jee-applications-cdi/

https://ops4j1.jira.com/wiki/display/PAXEXAM3/Pax+Exam;jsessionid=884744B7143030CD229BB9105F0F482D

https://ops4j1.jira.com/wiki/display/PAXEXAM3/Maven+Dependencies

http://ocpsoft.org/jboss/cdi-powered-unit-testing-using-arquillian/

 

https://github.com/jbosstm/quickstart/tree/master/ArjunaJTA/maven
http://planet.jboss.org/post/cdi_powered_unit_testing_using_arquillian0

 

http://stackoverflow.com/questions/6469751/testing-an-ejb-with-junit
http://ejb3unit.sourceforge.net/
http://www.junitee.org/
http://www.caucho.com/articles/JavaEE6_Testing.pdf
http://myfaces.apache.org/extensions/cdi/
http://deltaspike.apache.org/container-control.html
http://ctpjava.blogspot.com/2009/10/unit-testing-ejbs-and-jpa-with.html
https://www.42lines.net/2011/11/21/adding-jpahibernate-into-the-cdi-and-wicket-mix/
http://www.murraywilliams.com/2012/04/maven-and-jpa-programming/
http://www.brainhemorage.com/?p=292
http://www.mastertheboss.com/cdi/cdi-and-jpa-tutorial
http://www.slideshare.net/agoncal/injection-with-cdi-in-15-minutes-29358389

 

Bootstrap CDI
http://antoniogoncalves.org/2011/01/12/bootstrapping-cdi-in-several-environments/

 

http://needle.spree.de/overview

 

https://community.jboss.org/wiki/CreatingUnitTestsWithWeldAndJunit4

 

http://deltaspike.apache.org/documentation.html#testing-snapshots

 

http://planet.jboss.org/post/cdi_powered_unit_testing_using_arquillian

 

http://jglue.org/cdi-unit/

 

http://www.javaworld.com/article/2099020/open-source-tools/integrating-arquillian-and-jbehave.html?source=IFWNLE_ifw_java_2014-02-25#tk.rss_all

 

https://github.com/matzew/spring-cdi-bridge

 

Test REST
https://opencast.jira.com/wiki/display/MH/Unit+Testing+REST+Endpoints

 

https://code.google.com/p/rest-assured/

 

http://www.tmro.net/2009/03/unit-test-jax-rs-using-java-6-and-junit-4/

 

http://hc.apache.org/

 

http://howtodoinjava.com/2013/08/03/jax-rs-2-0-resteasy-3-0-2-final-client-api-example/

 

REST Mock
https://github.com/robfletcher/betamax

 

http://download.eclipse.org/recommenders/updates/stable/

 

https://github.com/forge/core#jboss-forge-20
http://download.jboss.org/jbosstools/builds/staging/jbosstools-forge_master/all/repo/

 

http://projectlombok.org/

 

JBoss AS 7 and JBoss EAP 6.1.1 Data Sources

Enterprise REST

http://martinfowler.com/articles/enterpriseREST.html

VisualJVM MissionControl Jconsole

http://visualvm.java.net/
http://visualvm.java.net/eclipse-launcher.html
https://visualvm.java.net/gettingstarted.html

JPA Tx
http://apmblog.compuware.com/2010/09/14/week-38-transactions-in-a-jpa-world/
http://www.adam-bien.com/roller/abien/entry/don_t_use_jpa_s
http://java.dzone.com/articles/jpa-performance-optimization
http://java.dzone.com/sites/all/files/Table1.png
http://apmblog.compuware.com/2009/11/12/w-jax-jpa-under-the-hood/
http://en.wikibooks.org/wiki/Java_Persistence/Advanced_Topics
http://docs.jboss.org/hibernate/core/4.3/manual/en-US/html_single/#configuration-j2ee
org.hibernate.transaction.JBossTransactionManagerLookupJBossAS
http://www.developerfusion.com/article/84945/flush-and-clear-or-mapping-antipatterns/
http://java.dzone.com/articles/jpa-performance-optimization

Hibernate Monitoring

—you can monitor a sessionfactory via JMX
—or call getStatistics
http://docs.jboss.org/hibernate/core/4.3/manual/en-US/html_single/#performance-monitoring

TestingDBviaJMeter

http://jmeter.apache.org/usermanual/build-db-test-plan.html

Java Load Testing Framework

http://grinder.sourceforge.net/
http://gatling-tool.org/

Debugging c3p0 pool

VisualizeEE

Document Your APIs

http://www.infoq.com/research/api-documentation?utm_source=infoqEmail&utm_medium=WeeklyNL_ResearchContent&utm_campaign=110513news
https://developers.helloreverb.com/swagger/
http://jashkenas.github.io/docco/

JBoss/JEETips

http://mastertheboss.com/jboss-as-7/a-thread-pattern-for-jboss-enterprise-applications
http://mastertheboss.com/resteasy/restful-web-services-on-jboss-as-7
http://mastertheboss.com/cdi/cdi-and-jpa-tutorial
http://mastertheboss.com/quickstart-tutorials-hibernate/jpa/jpa-21-tutorial
http://mastertheboss.com/jboss-performance/jboss-as-7-performance-tuning/page-2
http://mastertheboss.com/jboss-performance/jboss-as-7-performance-tuning

Java Leader
http://blog.arungupta.me/
p6SpyforJDBCInterception
http://sourceforge.net/projects/p6spy/
http://www.mastertheboss.com/jboss-datasource/how-to-trace-jdbc-statements-with-jboss-as
JDBC/JBoss/Hibernate/JPAPerformance
http://mastertheboss.com/jboss-performance/jboss-performance-tuning-part-2

UsePreparedStatementCache
RemovelogsfromConsole
TurnoffextraJBossservices

http://mastertheboss.com/jboss-performance/jboss-performance-tuning-part-1
http://mastertheboss.com/jboss-performance/jboss-performance-tuning-part-1/page-3
http://people.redhat.com/alikins/system_tuning.html
https://community.jboss.org/wiki/JBossASTuningSliming

Connection Pools

jboss-as-7-performance-tuning/page-4
jboss-as-7-performance-tuning/page-6

tune the cache

oracle-datasource-in-jboss-as-7.html
http://wiki.hq.bn-corp.com/display/TECH/2013/11/05/JPA+and+Other+Resources
http://javalabor.blogspot.com/2011/08/oracle-datasource-in-jboss-as-7.html
http://javalabor.blogspot.com/2012/01/java-verbosity-jee-and-lombok.html
http://stackoverflow.com/questions/12011174/persistence-xml-for-jboss-as-7-1-1
http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/hibernate4/
http://middlewaremagic.com/jboss/?p=1185
http://docs.oracle.com/cd/E35319_01/Platform.10-2/ATGInstallGuide/html/s0406configuringdatasourcesforjboss01.html
https://community.jboss.org/thread/228733?tstart=0
http://www.guj.com.br/java/256103-resolvido-seam-3–hibernate-4–jbossas7-erro-de-datasource
http://webcache.googleusercontent.com/search?q=cache:4OVwaejggxoJ:fascynacja.wordpress.com/2013/08/27/jboss-7-x-retrieve-datasource-properties-username-database-name-password-at-runtime-using-jmx/+&cd=1&hl=en&ct=clnk&gl=us
http://knowledgespreading.blogspot.com/2013/04/db2-and-orcale-database-configuration.html
https://community.jboss.org/wiki/DataSourceConfigurationInAS7
http://webcache.googleusercontent.com/search?q=cache:ioG7rPCfbD0J:qnatech.wordpress.com/2013/06/10/how-to-configure-jboss-datasource-oracleracre-connect/+&cd=1&hl=en&ct=clnk&gl=us
http://omarfaruq.blogspot.com/2012/05/connection-pool-tuning-in-jboss-to-get.html
true?
https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-Datasources
http://www.drdobbs.com/jvm/jdbc-fast-connection-failover-with-oracl/222700353
http://stackoverflow.com/questions/17180166/oracle-database-performance-issue-on-jboss-as-7
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/pdf/6.1.1_Release_Notes/JBoss_Enterprise_Application_Platform-6.1-6.1.1_Release_Notes-en-US.pdf
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/pdf/Administration_and_Configuration_Guide/JBoss_Enterprise_Application_Platform-6.1-Administration_and_Configuration_Guide-en-US.pdf
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/pdf/Development_Guide/JBoss_Enterprise_Application_Platform-6.1-Development_Guide-en-US.pdf
https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/pdf/Installation_Guide/JBoss_Enterprise_Application_Platform-6.1-Installation_Guide-en-US.pdf
http://www.ignitefree.com/
http://middlewaremagic.com/jboss/?p=1076

Passwords can be encrypted for databases

Java and Oracle Links

Advanced Java Programming Techniques with Oracle Database 11g

adv-java-prog-techqs-with-odb-400715-en-in.pdf

http://www.oracle.com/technetwork/database/enterprise-edition/appdev-java-developers-perspective–132536.pdf

http://www.oracle.com/technetwork/database/enterprise-edition/mensah-ch1-129492.pdf

Oracle® Universal Connection Pool for JDBC

http://docs.oracle.com/cd/E11882_01/java.112/e12265.pdf

Oracle® Database JDBC Developer’s Guide 11g Release 2 (11.2)

http://docs.oracle.com/cd/E11882_01/java.112/e16548.pdf

Java Stored Procedures

http://www.oracle.com/technetwork/database/enterprise-edition/ow-30820-java-stored-proc-paper.pdf

Oracle Data Source

http://stackoverflow.com/questions/1427890/oracledatasource-vs-oracle-ucp-pooldatasource

http://stackoverflow.com/questions/2423490/how-good-is-oracle-universal-connection-pool-ucp/4444922#4444922

JMX For Spring

http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/jmx.html

for monitoring through visual jvm and many other tools

Hibernate and Log4j via JMX

http://architects.dzone.com/articles/watch-your-spring-webapp

http://www.javacodegeeks.com/2012/01/enabling-jmx-in-hibernate-ehcache-qurtz.html

Creating an Asynchronous, Event-Driven Application with Reactor

sprint boot cli
http://dsyer.com/presos/decks/spring-boot-intro.html#slide6
http://spring.io/guides/gs/spring-boot/
spring –help

What’s New for Java Performance, Scalability, and Security with Oracle Database 12c [CON8597]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8597

A JDBC Datasource for Failing Over and Replaying In-Flight Transactions [CON9234]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9234

Java SE and Oracle Java Embedded: What’s New and What’s Coming [CON8936]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8936&tclass=popup

Experiences with Evangelizing Java Within the Database [UGF8861]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8861&tclass=popup

Hitchhiker’s Guide to XQuery with Oracle Database 11g Release 2 and Oracle SQL Developer 3.2.2 [CON7615]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=7615&tclass=popup

RESTful Web Services [CON8852]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=8852&tclass=popup

Implementing Oracle Commerce: Best Practices for Experience and Commerce [CON9198] Oracle ATG and Oracle Endeca
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9198

JVM Diagnostics: Java Profiling in Production Environments [CON9571]
https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=9571

JPA Tracing

https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide

Testing

JPA / Data Tools

SQL 2

sqlparser/sql2jooq

SQL Parse, Analyze, Transform and Format All In One

Ninja Web Framework | Full stack web framework for Java. Fast and productive. Built on Maven – runs on servlet containers. –

java – How do I do “SELECT something IN (…)” with jooq? – Stack Overflow

Oracle SQL Analytic query – recursive spreadsheet-like running total – Stack Overflow

Alternative Approaches to Writing SQL in Java

Crazy Translations of Simple SQL Expressions to Various SQL Dialects | Java, SQL and jOOQ.

10 Easy Steps to a Complete Understanding of SQL – Tech.Pro

Column Stores: Teaching an Old Elephant New Tricks | Java, SQL and jOOQ.

activejdbc – Implementation of Active Record pattern in Java. Inspired by Ruby on Rails ActiveRecord – Google Project Hosting

P of EAA: Active Record

Carbonado – Home

Cumulus4j – Securing your data in the cloud – Home – Cumulus4j – Securing your data in the cloud

Apache OpenJPA —

Martin Fowler on ORM Hate | Javalobby

Joist

OrmLite – Lightweight Object Relational Mapping (ORM) Java Package

greenDAO – Android ORM for SQLite | greenDAO is a light & fast ORM solution that maps objects to SQLite databases.

Sugar ORM – Insanely easy way to work with Android database.

Spring Data JDBC generic DAO implementation – most lightweight ORM ever | Java Code Geeks

JDBC Utility Component

Empire-db relational data persistence

ahmetalpbalkan/orman

Torque – Apache Torque

Home | Apache Cayenne

Super CSV – Welcome

JGrinder Home Page

The MyBatis Blog

EclipseLink Home

Athena Framework for Java Overview – Athena Framework

 

 

Spring Tutorials – Links

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-customized-user-login-logout.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-service-dao-persistence.html

http://tshikatshikaaa.blogspot.com/2012/08/jpa-tutorial-with-examples-using-hibernate-standalone.html

http://tshikatshikaaa.blogspot.com/2012/10/spring-mvc-form-validation-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2012/09/spring-mvc-controller-junit-testing.html

http://tshikatshikaaa.blogspot.nl/2012/09/spring-web-jpa-hibernate-in-memory.html

http://tshikatshikaaa.blogspot.com/2012/11/serving-static-resources-with-spring-mvc.html

http://tshikatshikaaa.blogspot.nl/2012/09/junit-testing-spring-service-and-dao.html

http://tshikatshikaaa.blogspot.com/2013/01/anatomy-of-default-openshift-spring-web.html

http://tshikatshikaaa.blogspot.nl/2013/01/spring-selenium-tests-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-http-only.html

http://www.infoq.com/presentations/Introduction-WebSocket

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-from-java.html

http://tshikatshikaaa.blogspot.com/2012/10/setting-logging-dependencies-in-spring.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-rest-calls-with-ajax.html

http://tshikatshikaaa.blogspot.com/2012/10/returning-json-in-spring-with-annotations.html

http://tshikatshikaaa.blogspot.com/2012/11/fetching-json-with-ajax-in-spring-mvc-context.html

http://tshikatshikaaa.blogspot.com/2012/11/introduction-to-spring-jpa-data-features.html

http://tshikatshikaaa.blogspot.com/2012/11/spring-mvc-error-handling.html

http://www.dzone.com/links/r/caching_with_spring_data_redis.html

http://www.dzone.com/links/r/spring_mvc_how_to_use_sessionattributes_annotation.html

http://www.dzone.com/links/r/cloud_stack_of_your_dreams_bootstrap_and_spring_r.html

http://www.dzone.com/links/r/spring_roo_and_twitter_bootstrap_roostrap_for_spr.html

http://www.dzone.com/links/r/spring_transaction_propagation_tutorial.html

http://www.dzone.com/links/r/rest_services_with_jaxrs_and_spring_handling_lost.html

 

 

 

 

 

Ehcache + Hibernate / JPA and TomEE

Ehcache + Hibernate and/or JPA
OpenJEE / TomEE

No, Not Python, It’s the Holy Grails…

I’ve been evaluating a few different technologies for doing some rapid web development work and recently I have been looking at the bounty of available tools, libraries, frameworks and associates of Spring.  Spring ROO and Groovy/Grails are the big two RAD tools from SpringSource and they look pretty amazing.  I don’t think I’ve found the Holy Grail of Web App development, but these two tools are really helpful in rapidly developing apps.  I am hoping someone combines Roo or Grails with Vert.x to make a really awesome alternative to Node.JS.  I like Node.JS and have been doing JavaScript for a decade, but I prefer the languages of the JVM and Vert.x’s support for multiple languages is pretty awesome.  Hmmm, Vert.x in Grails.

With the excellent STS inside Eclipse, this gives Groovy and Java a great IDE for development, testing and debugging.  And that is something that is lacking for Node.JS.  Node.JS has a few tools out there, but nothing open source, free, full of awesome mature plugins (PMD, Checkstyle, GIT, Maven, JUnit, FindBugs, …) and just plain easy to use.  Eclipse also has plugins for working with CloudFoundry, Heroku, OpenShift and other Cloud environments.

Between Grails and Roo, I really like the fact that I can remove Roo at anytime and still have a fully functionally application setup that utilizes standard Spring tools.  It’s also easier to add other cool Spring projects like Spring Social, Spring Mobile, Spring Data and more.

Both Grails and Roo support MongoDB very well and that’s great too see.  I have a few Mongo DB instances on MongoLab, MongoHQ and OpenShift.  These services all have great free developer services that are great for learning, prototyping and for tutorials.  I am really loving Heroku and OpenShift.  It’s hard to pick one, so I didn’t.  I use them both.

Vert.x + Groovy is really cool, but again not much IDE support, tools or extra libraries.  It should grow start building support now, but competition with Node.JS is pretty fierce.

Interesting, Roo vs Grails Jobs.

 

 

But if you look at just Spring (which Roo is just a tool to help with a Spring project):

 

 

There’s also some great documentation, tutorials and books on Groovy/Grails since it’s been out for a while:  http://grails.org/Tutorials  http://www.infoq.com/minibooks/grails-getting-started On the other hand, Roo is newer, but since it generates standard Spring + Java, you are really just getting a good head start on your project.

Heroku has a nice article on using both with their awesome platform:   https://devcenter.heroku.com/articles/grails  and https://devcenter.heroku.com/articles/spring-mvc-hibernate.

I will post a Github repository of some samples soon.

 

Spring and Hibernate

Spring 3.1

http://blog.springsource.com/2011/01/17/green-beans-getting-started-with-maven-and-spring/

http://javarevisited.blogspot.com/2012/03/spring-security-example-tutorial-how-to.html

http://blog.springsource.com/2011/01/25/green-beans-getting-started-with-enterprise-messaging-and-spring/

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/

http://blog.springsource.com/2010/11/09/green-beans-putting-the-spring-in-your-step-and-application/

http://www.springsource.org/greenhouse/guide

http://blog.springsource.com/2011/01/07/green-beans-getting-started-with-spring-in-your-service-tier/

http://www.mkyong.com/tutorials/spring-tutorials/

http://www.mkyong.com/spring3/spring-el-lists-maps-example/

http://www.mkyong.com/spring/spring-auto-wiring-beans-in-xml/

 

Spring MVC
http://blog.springsource.com/2011/01/04/green-beans-getting-started-with-spring-mvc/

 

Spring Social

http://harmonicdevelopment.tumblr.com/post/13613051804/adding-spring-social-to-a-spring-mvc-and-spring

 

Spring Data JPA
http://www.springsource.org/spring-data/jpa

 

Spring Mobile
http://blog.springsource.com/2010/11/19/spring-into-mobile-application-development/

 

Spring for Android
http://www.developer.com/ws/android/development-tools/spring-android-bringing-spring-components-to-your-android-apps.html

http://xebee.xebia.in/2010/12/31/spring-android-spring-for-android/

http://www.makeurownrules.com/rest-spring-maven-android

http://devblog.limettengruen.ch/?p=72

http://blog.orange11.nl/2011/02/07/creating-an-android-app-for-your-website-with-spring-android-and-rest/

http://www.ibm.com/developerworks/web/library/x-springandroid/index.html

http://www.jmanzano.es/blog/?p=163&lang=en

http://www.mkyong.com/spring/spring-sending-e-mail-via-gmail-smtp-server-with-mailsender/

http://www.mkyong.com/spring/spring-quartz-scheduler-example/

 

Spring Hibernate

http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/

http://www.mkyong.com/spring/maven-spring-hibernate-annotation-mysql-example/

 

Hibernate 4.1.4 (JPA 2)

http://docs.jboss.org/hibernate/orm/4.1/quickstart/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html_single/

http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/

http://www.mkyong.com/tutorials/hibernate-tutorials/

http://www.mkyong.com/hibernate/maven-3-hibernate-3-6-oracle-11g-example-annotation/

http://www.mkyong.com/hibernate/hibernate-one-to-many-relationship-example-annotation/

http://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/

http://www.mkyong.com/hibernate/how-to-configure-log4j-in-hibernate-project/