Sandeep Sanaboyina

Ranch Hand
+ Follow
since Dec 14, 2009
Merit badge: grant badges
For More
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 Sandeep Sanaboyina

Found the issue. Had debug enabled for org.springframework in slf4j. Removing that fixed the issue.
7 years ago
Hi,
We have an application, we're working on. When deploying locally it fires up in a few minutes. However, when deployed to our shared development environment, each operation Spring does during start-up of the app, takes exactly 2 seconds. Or maybe it's the other way around: for every operation Spring does during start-up, it allocates 2 seconds to finish that operation.
Why is this happening? We're using Tomcat 8 and a fairly straightforward Spring MVC application.
Any clues?
7 years ago
Hello,

I have written some code trying to send a mail with Aspirin. It gives me the below mentioned exception. Can anybody help me with this.

Code:



Exception:
I have written a small jsp that displays the total memory and memory used by Tomcat on the screen.

I have tried with JAVA_OPTS and CATALINA_OPTS in the environment variables.

I have also tried setenv.bat

None if these are affecting the heap size of tomcat.

Is there any way I can fix the tomcat6w.exe to work ? Update some registries may be ? It used to work before.

Or any other location to set the heap for the Apache windows service ?
12 years ago
I am getting the error when running the tomcat6w.exe.

I will try the setenv.bat. But, I think it will be the same as setting the System Variables. How can I know if they are being used ?
12 years ago
Hi All,

I have tomcat installed as a service on a Windows 2008 server. The service is running fine. But when I try to use Configure Tomcat, I get the following error.

The specified service does not exist as an installed service.
unable to open the service 'tomcat6'

The main issue is that I have to specify the heap size for tomcat. But, since it is a service, I do not have a catalina.bat file. I have tried googling it and in most places they suggest using Configure Tomcat.
I cannot use the zipped version of tomcat as this is being used to run a BMC Remedy application. And it is in the production environement. So ; I cannot mess with it without knowing something definite.

I have also tried JAVA_OPTS and CATALINA_OPTS enviroment variables. But, I cannot check if they are actually used for running tomcat.

Any inputs are welcome. Thanks in advance.
12 years ago
Hi All,

I have tomcat installed as a service on a Windows 2008 server. The service is running fine. But when I try to use Configure Tomcat, I get the following error.

The specified service does not exist as an installed service.
unable to open the service 'tomcat6'

The main issue is that I have to specify the heap size for tomcat. But, since it is a service, I do not have a catalina.bat file. I have tried googling it and in most places they suggest using Configure Tomcat.
I cannot use the zipped version of tomcat as this is being used to run a BMC Remedy application. And it is in the production environement. So ; I cannot mess with it without knowing something definite.

I have also tried JAVA_OPTS and CATALINA_OPTS enviroment variables. But, I cannot check if they are actually used for running tomcat.

Any inputs are welcome. Thanks in advance.
12 years ago
Martin,

I think the inital problem was this.

I'm working with an oracle 11 database and need to process 53Million entries. This can take some time and my usual approach is to read the data into a Vector of records and then process them but this time I unfortunately run out of memory before all records are read.


So, the data is being loaded into a Vector and then processed. So, if the concept is to use a java stored procedure in the database, that might mean (As I understand it. Mr. Wolf should correct me if I am wrong) putting all this code in a class and placing it in the database. So instead of performing this operation in the pc/server it is done in the db. So, the issue will still be there, as processing 53 mil records in a vector will always eat a lot of memory.
Regarding the remaining.

Unless I'm grossly mistaken, everything that returns rows in Oracle is a cursor.

you are right

Opening an SQL query with prepared statement creates a cursor in Oracle database that is no different from, say, a ref cursor returned from a procedure.

right again

So if there are problems with cursors returned from SQL query described in the initial post, I assume the same problems would appear with any other method that creates the same or similar cursor.

As I understand it, the issue was not with the query but with the processing. Even if the data is used directly (not stored in a vector), the processing speed for a cursor in the DB procedure will be far more superior to a java program executing elsewhere. I am saying this out of personal experience, as I had to remove my java code and use procedures for processing of large volumes of records(of course I used java to call that procedure ). Db stored procedures will almost always have a better performance when compared to implementing the same logic java through jdbc. You are esentially eliminating a large number of IO calls and initiating just 1 IO call to start processing entirely in the DB.

Hope it clarifies.
Writing a Java stored procedure in oracle might not solve your problem. Instead of running your program in your pc/server you are running on the database server.
That would mean you will be using the resources of the database. So, you would eventually get the out of memory error again(probably a bit late as the db will have more memory to spare).

It would be better if you can use cursors in oracle procedures. That would solve your issues.
Depends on your connection pooling implementation.

For Example, in OracleConnectionCacheManager you have the refreshCache method.

Better check the javadocs for your connection pool class.
I don't think there will be any direct way to solve that issue. Your best bet is to avoid that exception by first cleaning the data or filtering it before inserting.

Since you are inserting lakhs of records, inserting one record at a time will drastically increase the time taken to complete the job. So, that solution might not work for your case.
Also, as you mentioned it is a large result set, it might not be a good idea to store them in collections and processing them as it will eat up a lot of your heap space.

i mean i get a resultset from the 1st query , loop over the records and for each of them eventually make another query using a different connection. Since it's already happened to me to have an error about having to many opened ursors (oracle), due to using the same connection to execute multiple statement while looping on a large resultset, i tend to use a new connection for each query i send to db. I whished to know what's the best strategy in this case : in this case would be to retrieve large resultset outside the transaction , build some java collection and then do the updates/inserts into the transaction ?

You can do this with a single connection. As you said you can loop over the records of the first resultset and for each record execute another statement. If implemented properly, you will not get the too many open cursors error. You might have got that error because you were creating the Statement/PreparedStatement inside the loop.

Can't say anymore on this without seeing your code.
I seriously doubt there will be a particular answer for this kind of a question.
What you pass to a thread will depend on what the thread needs to perform its job. It could be anything.
As Lester said, you better start looking at the driver documentation.

I don't think you can identify driver type with java methods.