Win a copy of Securing DevOps this week in the Security forum!

Tim LeMaster

Ranch Hand
+ Follow
since Aug 31, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tim LeMaster

Did you try /IBM/SDP70/runtimes/base_v61/ ?
9 years ago
Do you have access to the wsadmin tool? You can generate a heap dump manually.

Generate heap dump

I believe the process is the same for WAS 5.x
9 years ago
Both - Each application has a stack of Classloaders.

You have classloaders for each module in the application (WAR, EJB modules, etc)
A classloader across the application (EAR)
and classloaders from Websphere (ws.ext.dirs) and Java system (CLASSPATH variable) - which would be shared by all apps
9 years ago
You can certainly do this, the JMS libraries use the MQ libraries so in the end you depend on the base libraries. From a compile stand point if you are running inside an Application Server like websphere you should be able to look up the ConnectionFactory and Queue via JNDI and only compile against the JMS interfaces.

If you are writing an application outside of an application without a JNDI provider its debatable if using the JMS libraries would be better or not - as you will have to configure the ConnectionFactory via the JMS MQ library - tying you to it at compile (versus runtime via JNDI). I'd still use JMS though as the rest of the code can probably just use the JMS interfaces and only setting up the ConnectionFactory would be MQ specific (you might also have to set some MQ specific settings on the Queue depending on the kind of message you want to send).

If you want to send text back and forth use a TextMessage and set on the Queue - queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ). If you configure this via JNDI you can avoid all MQ specific code in your classes.
[ September 02, 2008: Message edited by: Tim LeMaster ]
9 years ago
WAS CE - Is a free app server built on Apache Geronimo.

WAS - Is a commercial offering.
9 years ago
Yes - Oracle - Ejb Transaction Across Database Links

This article is about EJBs but it applies because the transaction is done simply by using the same connection. So you could execute both statements and only call commit if they both succeed.

You could also do an XA transaction via JTA pretty easy in Spring via JBossTS.
I noticed your old and new profile were named the same - AppSrv01. When you delete a profile it does not delete the files under the profile directory - if you create a profile with the same name the old problems are going to crop back up. Create a new profile name or go delete the profile directory (after deleting the profile) in C:\IBM\SDP70\runtimes\base_v61\profiles.
9 years ago
A unit test that loads the ApplicationContext ought to do it. While you are at it you could attempt to pull each Bean and make sure you get them and they are of the correct type.
Depends on what you are unit testing.

If I wanted to Unit test the actual SQL (does the SQL do what I think it should) I would use DBUnit to put the database in a known state and make sure I got back the data I wanted.

If I wanted to test some DAOs and make sure the correct SQL was going to be passed to JDBC calls and the resources properly closed I would use Mockrunner - specifically the BasicJDBCTestCaseAdapter.
That is because the JDBC connection is not setting up this when it is connecting. Besides the client machine/browser is not connecting to the database - the app server is (where SessionBean is running) more over it is probably using a Connection Pool so all users are running under the same username/password to the database.

Most likely you need to capture the username they logged into the application with and send that along with the insert to capture the user actually making the change.
Is the admin servlet running on your machine on port 8080?

What do you see when you go to the Admin Service in your browser?
9 years ago
Hibernate is trying to save you some overhead if you load the Employee object but don't need the Department object. Basically hibernate returns a proxy object that doesn't load the Department from the database until you actually call it. However that causes a problem when you open the session in your DAO and then the session closes when your DAO completes. Then you return the Employee object to your web layer and it called getDepartment which the proxy tries to load from the database and discovers there in no session and throws an Exception.

Understanding Lazy Fetching
9 years ago
The Javadoc for ResourceBundle.getBundle goes into detail on this
9 years ago
You need to look into wait() and notifyAll(). You should use wait() in the getting the connection if no connections are available. This will release the lock and block until another thread with the lock calls notifyAll().

Your synchronized method gets a lock on the instance of the DBConnectionPool that the thread is using to invoke the method. However inside of the method you are accessing a static array of DBConnectionPools - so the code could be trying to allocate a connection from a pool you do not have a lock on. Of course this doesn't seem to be the whole class so things could be different in the real code. Which is a reason to post the entire class.