Home » Author Archives: Abhishek Gupta

Author Archives: Abhishek Gupta

Pre Java EE 7 alternative to JPA 2.1 unsynchronized persistence context

java-interview-questions-answers

Unsynchronized persistence context in Java EE 7 JPA 2.1 introduced the concept of unsynchronized persistence context which allows fine grained control over flushing of the JPA Entity Manager i.e. by explicitly calling EntityManager#joinTransaction. Previously, this was defaulted to end of JTA transaction e.g. in a typical Stateless EJB, the entity manager would flush its state to the DB at the ...

Read More »

Automated provisioning of JMS resources in Java EE 7

java-interview-questions-answers

JMS 2.0 (part of the Java EE 7 Platform) introduced lots of nice features. One of these was the ability to declare JMS resources for automatic deployment. Pre Java EE 7 Inject Connection Factory using @Resource Lookup Destination (Queue/Topic) using @Resource Pull out the Session object and use it to create the Message, Message Producer and send the message Most ...

Read More »

Implementing auto retry in Java EE applications

java-interview-questions-answers

Initially, I wanted to call this blog – ‘Flexible timeouts with interceptor driven retry policies‘ – but then I thought it would be too ‘heavy’. This statement, along with the revised title should (hopefully) give you an idea of what this post might talk about ;-) The trigger This post is primarily driven by one of the comment/question I received ...

Read More »

Basics of scaling Java EE applications

java-interview-questions-answers

To be honest, ‘scalability’ is an exhaustive topic and generally not well understood. More often than not, its assumed to be same as High Availability. I have seen both novice programmers and ‘experienced’ architects suggest ‘clustering‘ as the solution for scalability and HA. There is actually nothing wrong with it, but the problem is that it is often done by ...

Read More »

JAX-RS and JSON-P integration

json-logo

This short post talks about support for JSON-P in JAX-RS 2.0 JSON-P …? The JSON Processing API (JSON-P) was introduced in Java EE 7. It provides a standard API to work with JSON data and is quite similar to its XML counterpart – JAXP. JSON-B (JSON Binding) API is in the works for Java EE 8. Support for JSON-P in ...

Read More »

Native CDI Qualifiers: @Any and @Default

java-interview-questions-answers

Let’s take a look at the out-of-the-box qualifiers in CDI There are three qualifiers declared by the CDI specification – @Any, @Default, @New @Any: Think of it as an omnipresent qualifier. It’s there even if its not ;-) @Default: As the name suggests, this qualifier treated as a default when none other qualifiers have been specific. The only exception to ...

Read More »

Introductory NoSQL stuff

software-development-2-logo

While some of you might be NoSQL gurus, there is often a lack of solid knowledge about NoSQL in general and some common myths as well. Specifically, topics like NoSQL applicability/use cases and its comparison (fair and unfair) against relational databases are often driven by incomplete knowledge. I do not claim to be an expert in the NoSQL domain, but ...

Read More »

New in JMS 2.0

java-interview-questions-answers

This post lists ALL of the new APIs (interfaces/classes/annotations etc.) introduced in JMS 2.0 (part of the Java EE 7 platform). These have been categorized as follows API simplification Ease of use Exception Handling Miscellaneous Here is a quick summary along with some code snippets API simplification JMSContext Simpler abstraction on top of Connection and Session objects which eliminates the ...

Read More »

Random JCache stuff: multiple Providers and JMX beans

java-interview-questions-answers

JCache (JSR 107) is the Java standard for Caching… enough said. No more introductory stuff. This is a quick fire post which talks about Multiple JCache provider configurations, and Feature: JCache stats via JMX Mbeans Managing multiple JCache providers In case you are dealing with a single JCache provider, javax.jcache.Caching.getCachingProvider() returns an instance of the one and only CachingProvider on ...

Read More »

WebSocket Client API in Java EE 7

java-interview-questions-answers

In this post, let’s explore the less talked about Web Socket Client API and how to leverage it within a Java EE 7 container itself. Web Socket Server API rules The server side API of JSR 356 (Web Socket API for Java) is most commonly used for building Web Socket endpoint implementations. More often than not, from a client perspective, ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns