Akshay Lele

Greenhorn
+ Follow
since Apr 06, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Akshay Lele

Hi All,

I am interested in knowing if the method "getLinkedException()" of JMSException returns the topmost exception(DetailedJMSException) in the stack trace, or the bottom most(JmqiException)
Consider the snippet below:

This gives something like this,

In case i am unclear let me know, i will detail out more.

Thanks in advance!!!

Regards,

Akshay
Hello All,

Thank you all for your thoughts, they are greatly appreciated and valued.

Regards,

Akshay Lele
10 years ago
Hello All,

My name is Akshay and i am from India. I have 5 years of experience in java, in these 5 years i have worked on various technologies and frameworks related to java like springs, jpa, web-services etc and i am pretty good at it.

But i some how have started to feel that i have a very limited view of the IT industry, for me at least as a developer it starts from getting the high level design from architects, preparing low level design documents then coding testing and it ends there.

I want to understand more about the IT industry, how it works at a higher level. How budget is earmarked for a project, what are the criteria s that come into play on deciding whether the business should put in the money. Who makes these calls. How risks are identified and dealt with? How companies sell their products and services. What preparation goes behind it.

In a nut shell i want to understand how the IT business is run?

Based on the above can anybody suggest as to what career path i should take, what education should i take to enhance my knowledge?

This is really bugging me as of now, hence greatly appreciate any views on the same.

Thanks.

Akshay

10 years ago
Hi All,

I am using Open JPA and Websphere server.

I am trying to develop a code in JPA that can switch between 2 data sources. It would be some thing like this, where useOracleDS is the environemnt variable:

if (useOracleDS){
Call method setPersistenceUnitName("oracle") on object of LocalContainerEntityManagerFactoryBean.
}
else{
Call method setPersistenceUnitName("informix") on object of LocalContainerEntityManagerFactoryBean.
}

Some extra info, the two data sources are for production(informix) and DR(oracle) hence they have the same table names etc.

My question is this option correct or there are other good options in JPA for do the switching between 2 data sources.

I have just started using JPA so any help on this would be greatly appreciated.

Thanks a lot.
Thank you Mark. I also implemented PropertyPlaceholderConfigurer successfully.
13 years ago
Hi All,

I have a Spring 2.0 project. For data access good old JDBC code is used i.e specifying SQL query in a String variable (the code was written some time back so cant change that part).

There are 2 data bases of different vendors and they have the same tables, at one time though only one will be in use. The problem is column name of a table in one DB is a reserved word in other DB. To get over this in other DB the column name has been changed.

Here in lies my problem, as if there is switching from DB1 to DB2 the SQL query will have to change so as to reflect the correct column name.

The two ways that i have figured out around this is as follows:

1. Set an environment variable in the Websphere admin console. This would hold the value of the column name. In case of DB switching just change this variable to a appropriate value. The java code will say

Hence no change in application code.

2. Use DatabaseMetadata interface's getColumns() method.

Is there any other way to do this, especially in context of existing Spring classes(not JDBCTemplate etc) or some other way.

I would really appreciate any help on this.

Thanks,

Akshay
13 years ago

Mark Spritzler wrote:Yes.

Both are good approaches.

If you are using the latest Spring version you can use the JVM Variable and SpEL Spring Expression Language to dynamically get it. So you wouldn't have to code System.getProperty("myPropertyName");

instead in your xml the value could be

#{systemProperties.myPropertyName}

or if you are using an older version of Spring you can use a PropertyPlaceholderConfigurer, you don't even need to set it to a .properties file. But by default the PropertyPlaceholderConfigurer will look for a property called myPropertyName first in the .properties file if there is one, then go to System.getProperty(), then look for an environment variable.

Mark



Thank you Mark for the info. I am using a older version of Spring hence would try using PropertyPlaceholderConfigurer. But is there no definite advantage of using approach 1 over 2 right?
13 years ago
Hi All,

I am working on a Spring project in which there are 2 JNDI data sources. At a time though only one JNDI data source will be used. Basically the client wants to easily switch between this 2 data sources, again this is not to be done at run time.

So to make the application code independent of the data source currently being used there are 2 approaches that i have figured out.

1. Use JNDIObjectFactoryBean class. Specify the jndi name in xml file. Inject the factory bean in DAO class to get Data Source.
In case data source needs to be changed just change the jndi name only in xml file, no change needed in DAO code.

2. Use a JVM Variable and set in Websphere. In DAO use System.getProperty() get the value of the variable. In case data source needs to be changed just change the value of JVM Variable. Here also there would be no change in DAO code.

What i really want to know is which would be a good approach (Point 1 or 2)? If any of you can tell me the pros and cons of these 2 approaches(with respect to performance etc) i would really appreciate it.

Thanks in Advance.

Regards,

Akshay
13 years ago
Hi All,

I have to create a SOAP message as below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>

To achieve this i created an instance of SOAPMessage object using MessageFactory.newInstance().createMessage().

The problem is it gives me the SOAP message in default format as below:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>

Any help would be much appreciated.

13 years ago

Akshay Lele wrote:Hi can anybody tell me how much time will i take for preparing for scjp 6.0.When i play the cattle game at java ranch i get feedback as silver spur.Thanks in advance



Hey thnk you very much.I did get your point across.I think i would require around at least a months time for preparation.
Hi can anybody tell me how much time will i take for preparing for scjp 6.0.When i play the cattle game at java ranch i get feedback as silver spur.Thanks in advance