Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!

Nitin Gaur

+ Follow
since Sep 06, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nitin Gaur

Vaibhav, So you want to know that the transaction strategy should be applied to which layer? Service or DAO.
If the question is correct then the answer is Services layer. Transactions handling should go in DAO layer only if Services layer does not exist. For more about transaction strategies, read
To be precise, if using Spring then use Spring to manage transactions preferrably declaratively.

-Nitin Gaur
7 years ago
Came across this thread while searching JDBC vs JPA discussions.

I have batch application that fetches customer data (from multple tables), get it processed from an external app, stores the results back in same database (different set of tables). This batch has to run for around 100 thousand (100,000) customers.
We thought to use JPA with openJPA (sorry no hibernate) though no solid reason but it is proving to be slower than expected. Now, conteplating to switch to JDBC. Have not done JDBC test yet but inviting point of view if it is right approach?

8 years ago
Thanks for the reply Mark.

Interested to know what would be the recommended way to load the context in a messaging application i.e. the entry point is JMS message.

I have initially created RAR and deployed in app server's resource adapter but it turned out to be pain in development as it required server restart after every deployment + few other issues.
Then, wrapped that RAR into an EAR and deployed as normal sever application. So far, this is working fine but I am not sure if it is a recommended solution or just workaround.
8 years ago

Craig Walls wrote:Put simply: The "Application Context" is another name for the Spring container. Spring's primary job is to manage the lifecycle and relationships between a lot of objects. It does that by loading them in its container.

To load the container..well there are several answers to that, depending on how you build your application. Typically, there's one or more XML files that contains one or more <bean> declarations (although these XML files keep getting smaller thanks to some special namespaces, annotations and autowiring).

If it's a web application then those XML files are loaded by either DispatcherServlet and/or ContextLoaderListener. If it's an OSGi bundle, then they're loaded by the Spring-DM extender. If it's a standalone (e.g., has a main() method) application, then you might load them a little something like this:

And there are other ways to load it...kinda depends on the circumstance, though.

I'm very much interested to know all other ways to load contexts apart from web application and standalone java application
8 years ago
Error is resolved. I work on virtual machine. All developer images were copied from a particular VM and that brought over WAS configs (hostname, cell, node etc) with it. Remote access worked after fixing all occurances of hostnames in serverindex.xml of the server hosting EJB.
8 years ago
I have 2 applications - one EAR containing EJB3.0 and other its Spring client. Both deployed on same Websphere app server 7 instance i.e. same JVM.

Here are couple of client parts:


Client code snippet:

This works fine. EJB access deployed in other application in same container, works.

But it does not work if I move that client to other machine in same network and just change provider URL and give remote server IP instead of localhost. JNDI lookup problem occurs

Exact Error: Error 500: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleService' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Context: CFSDDVM2399Node01Cell/nodes/CFSDDVM2399Node01/servers/server1, name: com.ecrd.ruleservice.Customer_Management_Service_JavaBusiness: First component in name com.ecrd.ruleservice.Customer_Management_Service_JavaBusiness not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:]

I can't figure out what changes (and where) are required to connect to EJB hosted in different server JVM. Any help or suggestion are welcome.
8 years ago
Thanks Srini, That helped.

Another question - Lets say if Provider implements Provider<Source> and also retuns Source type object in response then there is no SOAP in it. It is just plain XML over HTTP. (Correct me if I'm wrong) So if I can implement JAX-WS compliant web service in this way then why do I need to carry SOAP baggage? In other words, between Provider<Source> and Provider<SOAPMessage> which one you would choose and why?
10 years ago
Hi - Below is Provider interface API description. I have some questions. Can some one please answer?
Interface Provider<T>

public interface Provider<T>

Service endpoints may implement the Provider interface as a dynamic alternative to an SEI.

Implementations are required to support Provider<Source>, Provider<SOAPMessage> and Provider<DataSource>, depending on the binding in use and the service mode.

The ServiceMode annotation can be used to control whether the Provider instance will receive entire protocol messages or just message payloads.

1) If client is sending SOAP message, I can still receive only payload by using Provider<Source> and ServiceMode as PAYLOAD?
2) If I just receive PAYLOAD, not entire message, how will I convert response into SOAP message while sending back?
3) What are the scenario in which you may want to receive Source or SOAPMessage or DataSource bindings?
4) What are the scenario in which you prefer Provider interface instead of SEI (Service Endpoint Interface) approach?

10 years ago
Thanks Evan,

But I wonder how would I generate the XML just by looking at the schema (if available). I must generate JAXB bindings from WSDL, populate them and then do marshaling to generate the XML SOAP message. Right?

The motivation to process raw XML is to provide uniform processing at server side that defines XML as common input format to integrate through any type of communication medium e.g. SOAP/HTTP or JMS or RMI (rare case)
10 years ago

Rohit Chaudhary wrote:Hello all,

I am beginner in area of Web services.
I am kind of confused from where to start learning web services. There are many areas like JAX-WS , Axis web services etc.
I know little bit about SOAP, WSDL. Can someone guide me regarding how to go about learning WS so that I can understand concepts better.

Thanks in advance.

Focus on JAX-WS which is sun specification for web services. Read about it. Also understand what is SOAP and WSDL.
Then pick up sun's reference implementation of JAX-WS at and build some simple services and clients. Knowing Axis is not important unless you must use it in your project.
10 years ago
We are considering 2 approaches while exposing web services to internal applications. Please help in deciding the pros and cons of each.

Approach-1 is now standard in which JAXB bindings are applied at both sides (client and server) internally. Client and Server code work on Java objects and not on SOAP XML message directly.

Approach-2 is old way in which JAXB bindings are NOT applied at both sides (client and server) internally. Client constructs SOAP XML message and server receives XML and unmarshall into JAXB object.
10 years ago
We are considering 2 approaches while exposing web services to internal applications. Please help in deciding the pros and cons of each.

Approach-1 is standard in which all operations are exposed. Client generate jaxb bindings and knows what operation to invoke and call the service accordingly. No need to provide additional documentation to client other than WSDL. But whenever WSDL is updated, client side artifacts need to be generated again to support the changes in WSDL

Approach-2 is not common in which only one operation is exposed and client generate jaxb bindings once and knows what operation to invoke, set a parameter in header and call the service accordingly. Service provider identifies the operation based on the parameter in the request header. Need to provide additional documentation (about parameter to business operation mapping) to client other than WSDL. But whenever WSDL is updated, client side artifacts need not to be generated again to support the changes in WSDL
10 years ago

From job point of view, certification helps in getting your resume shortlisted for interview. You still have to clear the interview based upon your experience and knowledge. Yes, certification (if it is in your area of interest) ALWAYS adds value to your skills.


My project is going live soon on Prod, it is phase-2 development of an existing app running in prod. Since it is major revamp so DB guys (Oracle) have created a production parallel schema so that they start populating the data one week before and on Prod deployment date, app is deployed pointing to new schema and everybody go happy.
If I give names, lets say current schema is "Phase1" and new schema is "Phase2"

Now the problem: All of my entity classes have schema "Phase1" specified and when this moves to Prod, it will fail because new schema is "Phase2".
And, I must specify the schema in entities because app uses different aliased login credential

Want to know how to handle this problem for such enterprise level roll-out?

Thanks in advance!
For JDK1.5 or below, use Jprobe or JProfiler. For JDK1.6, use VisualVM.
But before getting deeper with tools, you can put start/end time logs and pinpoint the bottleneck code.
10 years ago