samir ware

Ranch Hand
+ Follow
since Jul 27, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 samir ware

Hello Ranchers
I am having a requirement to upload a large chunk of files through HTTP. For that I am planning to use multipart upload.
Although I am not sure whether we can store the files on some network machine once it reaches to Controller/servlet ? (From Controller/servlet to some network machine)
If its possible can someone please let me know the sample code/ API for the same ?
Any link , white paper will greatly be appreciated.
Thanks in advance
Samir
10 years ago
Hello Ranchers
I was able to resolve this issue. On weblogic console one need to set the below mentioned value in the "System Properties" box under "Data Source" -> "Your Data Source" -> "Connection Pool" - > properties



This worked for me .
Happy coding
Thanks
Samir
Hello all
I am using hibernate along with spring and weblogic server. However when I persist any Chinese data into the database using hibernate, its not getting persisted properly. I was able to find its fix on local by using following configuration.



However on production, I am using weblogic datasource thery by doing jndi lookup. Because of this there is no way I can use this configuration on production. The datasource look up is being done through below configuration.



I tried setting up below mentioned configurations on persistence.xml although it did not yield any result

Can someone please tell me how should I deal with this situation ?
Any link , white paper will greatly be appreciated.
Thanks in advance
Samir
In a nutshell I want to call some method which does not need to be transactional from a transactional method.

Is there any way I can do it ?

Thanks
Samir
10 years ago
Hello Ranchers
I have a spring application which is based on Spring Batch. By default spring batch introduces transaction for its steps. There are certain stages where I don't really need transaction to be enabled. Because transaction is enabled unnecessary for these methods its giving me some runtime errors as I am making call to two different databases in one method.

Is there any annotation which spring provides to DISABLE transaction for a specific set of methods ?

I am even open to the solution which can disable transaction globally.
Any link , paper will greatly be appreciated.
Thanks in advance
Samir


10 years ago
Hello Ranchers
I am working on a web application in which there are few DB inserts happening. All these DB inserts I am doing thorough JAP by using multiple threads.
I am little confused about the fact that I can see all my threads in running state even when their processing is done.
I am using ThreadPoolExecutor for creating threads. Although if I close the threadpoolExecutor as shown below, when the thread is done with the processing, ThreadPoolTaskExecutor will never get opened for next request and I get the exception.




Is keeping the threads in running state even when their processing is done is desired behaviour or I need to make them sleep or in ready to run state when their processing is done ?
If I have to return the threads sleep when processing is done, how can I do that using ThreadPoolTaskExecutor ?
Any white paper, link will greatly be appreciated.

Thanks in advance
Samir
Hello ranchers
I am novice to spring batch. I have created and successfully executed job from spring by using multiple threads and it works perfetly fine except that when program execution is complete, program flow does not comes to end/halt. i.e. even when the last statement of main method gets executed program does not exit. I am not sure whether it keeps on waiting for threads to complete or what. Can someone please advice on this ? "Below is my config file for job



And below is the launcher code



As stated above, the code runs in 5 different thread for the task "hello" and once for task "world" though it does not bring the execution of main program to halt even after the last line of main method "End of execution" gets executed. Any link white paper will greatly be appriciated.
Thanks in advance
Samir
11 years ago
Hello Rancher
I have a list few few thousand String records in it and this list is in the sorted order. I am willing to locate the indexes from the list for different alphabet. For example if records starting with alphabet "A" are 4,records starting with alphabet "B" are 5 and that with "C" are 6 then some XYZ function should return me a map as shown below

A - 0
B - 5
c - 10

which is nothing but the index inside the list at which records starting with specific letter are observed. i.e. records starting with alphabet A are startign at location 0 , records starting with alphabet B are starting at location 5 and records starting with alphabet C are at location 10(0 to 4 records are for A , 5 to 9 records starts with B so records with C will start at index 10).
This in a nutshell its a pattern matching in the list.
Any algorithm , pseudo code or white paper will greatly be appreciated.
Thanks in advance
Samir
11 years ago
I have not done any explicit mapping except mapping columns to the specific fields as below.



Do I need to do any explicit mapping if I am triggering union query.
I can execute other simple queries but not the one which has union in it
Thanks
Samir
I am not sure what exctly is EclipseLink .. Though I am not using it . I am with bare JPA's API. . So eclipseLink is something on which I cant relay
Hello James
Thank you so much for the reply.
I have two tables , one is for maintaining document information and other one is for maintaining operations on the documents. (e.g. update,delete) . Both are jsut replica of each other where one is maintaining others audit information.

Both the tables are mapped to two different objects.
I was trying to execute below mention code though I am getting "column not found" exception.
Can you please tell me where exactly I am missing ??
Hello all
I am trying to map below mention query in JAP.



I have two seperate java classes viz one for master and other for history table. Though I am not getting how exactly should I write the JPQL query or rather which API I am suppose to use to grab the data from the query mentioned above.
Any link, white paper will greatly be appricaited.
Thanks
Samir
Thank you so much for the quick response Rob and Steave.
Though i am still little confused about what happens internally when thread tries to invoke method on an object which is of Truly singlton class.Does the thread takes the LOCK over the object and then invoke the method ? If this is true then I guess all singlton will be inherently synchronized . Am I thinking in right direction ? Or there is something else that is happening ?
Thanks in advance
Samir
Hello ranchers
Can somebody please tell me how does a singleton object behaves when multiple threads tries to access it. Does it get locked or does each thread carries a separate but identical copy of the same object when multiple threads tries to access it.? Any link white paper will greatly be appreciated .
Thanks a in advance
Samir