C3P0 Connection Pooling Example

C3P0 Connection Pooling Example exaplains about how to create and configure a Connection pool using C3P0 Datasource

Creating and establishing a database connections are relatively very expensive because of establishing a network connection, initializng database session, authorization in the back end database etc.

Due to this issues, it is good practice to use a connection pool in your applications in order to increase the performance and scalability. By using Connection Pool, you can re-use already existing connections and prepared statements, so that you can avoid the cost of establishing the connection.

C3P0 is an easy-to-use library for augmenting traditional (DriverManager-based) JDBC drivers with JNDI-bindable DataSources, including DataSources that implement Connection and Statement Pooling, as described by the jdbc3 spec and jdbc2 std extension.

Reference -> http://sourceforge.net/projects/c3p0/

CXF java.net.SocketTimeoutException: Read timed out

This exception happens, when invoking the client and it takes 50-60 seconds after that  we get java.net.SocketTimeoutException: Read timed out, following are the stacktrace

Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage
(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:171)
... 26 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)

This article explains about how to fix this exception in CXF way

BoneCP Connection Pooling Example

BoneCP Connection Pooling Example exaplains about how to create and configure a Connection pool using BoneCP Datasource

Creating and establishing a database connections are relatively very expensive because of establishing a network connection, initializng database session, authorization in the back end database etc.

Due to this issues, it is good practice to use a connection pool in your applications in order to increase the performance and scalability. By using Connection Pool, you can re-use already existing connections and prepared statements, so that you can avoid the cost of establishing the connection.

BoneCP is a fast, free, open-source, Java database connection pool (JDBC Pool) library. If you are familiar with C3P0 and DBCP then you already know what this means. For the rest, this is a library that will manage a database connection for you to get faster database access in your application

Reference -> http://jolbox.com/

Hibernate JPA One To One Relation Mapping Example

Hibernate JPA One To One Relation Mapping Example explains about how to implement a One To One relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

one-to-one entity relationship, each record of an entity have single records in other associated entity

On this standalone One To One Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table

Generate Class Diagram Using Eclipse

Generate Class Diagram Using Eclipse explains step by step details of installing and configuring ObjectAid plugin with eclipse, this plugin will automate the generation of Class Diagram and Sequence Diagram from java source code.

You need to remember one thing that for generating Sequence Diagram, you need a valid licence. But for generating Class Diagram, it is free.

ObjectAid UML Explorer is an agile and lightweight code visualization tool for the Eclipse IDE.

It shows your Java source code and libraries in live UML class and sequence diagrams that automatically update as your code changes.

Reference -> http://www.objectaid.com/home

Hibernate JPA One To Many Relation Mapping Example

Hibernate JPA One To Many Relation Mapping Example explains about how to implement a One To Many relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

one-to-many entity relationship, each record of an entity have multiple records in other associated entity

On this standalone One To Many Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table

Hibernate JPA Many To One Relation Mapping Example

Hibernate JPA Many To One Relation Mapping Example explains about how to implement a Many To One relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

many-to-one entity relationship, multiple records of an entity have single record in other associated entity

On this standalone Many To One Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table

Hibernate JPA Many To Many Relation Mapping Example

Hibernate JPA Many To Many Relation Mapping Example explains about how to implement a Many to Many relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

many-to-many entity relationship, each record of an entity have multiple records in other associated entity and vice versa

On this standalone Many To Many Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table