venkata Silla

Greenhorn
+ Follow
since Apr 07, 2015
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by venkata Silla


Hi Team,

Let me share my recent interview experience which is a scenario driven. "Assume I have 4 database update operations( 2 SQL Server and 2 Oracle DB).Lets say the first DB SQL updates went fine which are hitting to SQL Server and while running the second DB SQL Query(Oracle) I got a system exception.How do I rollback the SQL update happened on my first database. Since I use different JDBC Connections for both. How do I rollback the changes which were happened on the First DB with out any code change and throw an exception saying system error using spring transactional management.

Thanks a lot for sharing your expertise.


Venki-

4 years ago
Thank you very much,Being trying to search with the keyword.It worked
5 years ago
yes, Is it possible to mock the dao.getPendingRecords() to give different results

like during first visit it should return some records and In latter cases it should return 0 records
5 years ago
Hi,

I'm sorry for the confusion around,Basically my requirment is to get all the records from the database and process it in chunks,For example 500 records at a time so the below code does that.
I'm trying to do a JUNIT Testing my mocking the List Object .Suppose,If I mock the list size to 2 elements The below program will run forever(Infinitly) I'm trying to write a JUNIT with out touching the actual code,I know list.clear()works but i dont want to touch the actual source code inorder to pass with JUNIT. Appreciate your thoughts.Thank you




5 years ago
Basically,If I pass some values to the list,Lets say I inserted 2 items in the list as per the loop it never comes out since we are mocking the array list with 2 items all the time and i m looking for some mocking logic to mock the arraylist to empty once it read all the elements from the list. In other words after forEach loop i want to set the list to empty so that it will come out of the loop.

do{
arrayList = MOCKIT(ArrayList); // During here I need to mock some values to the arrayList to pass through the forEach loop
for(Object record : arrayList)
{

//PROCESS ALL RECORDS

}

arrayList = MOCKIT(ArrayList);//Here i need to mock the arrayList to 0 to come out of the do while loop.
}while(arrayList.size >0);
5 years ago
Hi Experts,

I'm new to EasyMock JUNIT API,I got a requirement where i need to mock an arraylist in such a way that

1)Initially I need to initialize the list with some values to make sure the application logic trigger based on the List size

2)To exit out of the loop i need to dynamically mock the ArrayList size to 0 To come out of the loop.

Please share your expertise.Appreciate it..


To Illustrate

do{
arrayList = MOCKIT(ArrayList); // During here I need to mock some values to the arrayList to pass through the forEach loop
for(Object record : arrayList)
{

//PROCESS ALL RECORDS

}

arrayList = MOCKIT(ArrayList);//Here i need to mock the arrayList to 0 to come out of the do while loop.
}while(arrayList.size >0);

5 years ago
Hi,

I'm new to EasyMock Java API, I'm trying to figure out the way to mock void methods ,I have a Wrapper class which is calling dao helper class void method.I'm trying to mock the dao void method

I have written a Java Unit class to test the Wrapper doProcess Method, I have mocked the Dao instance in the WrapperTest.java class Since the dao delete method is void which i cant able to add EasyMock.Except() method since it only takes method which has return types.

For Example:


Wrapper.java

void doProcess(){

pedingRequestDao.deleteRequests(List);
}

My question Is there a way to mock the dao void method ?Please help I'm getting the below exception

java.lang.AssertionError
Unexcepted method call dao.deleteRequest([12345.2345]);
5 years ago
Hi Team,

I'm new to the Spring Frame work,I have a ServiceImpl class and Though I'm not defining <Bean> Property properties in the context.xml the auto wiring is working to look up the dependency objects of the ServiceImpl class.Let me explain using an example,The below Dependency Injection is happening even I'm not mapping the Dao reference to the bean.Please share your thoughts

1)


context.xml
5 years ago
Hi Team,

Good Morning,

I'm new to Spring PdqDaoSupport API(org.springmodules.purequery.support.PdqDaoSupport) and I'm trying to look for the syntax to execute the below query.How to pass values dynamically need some help on retrieving the data from the tables.Does the TABLE to POJO mapping happens internally ? Spring will take care of that and Please suggest me some tutorials or links which contains some examples.
I tried searching online but i'm not able to find any thing with PdqDaoSupport. Probably I'm not sure whether i'm searching in the right way or not.Thanks a lot...


import org.springmodules.purequery.support.PdqDaoSupport;

public class AccountDao extends PdqDaoSupport {

/*
* Developer will write code here
*/

public Account[] getAccounts() {
String sql = "SELECT * FROM ACCOUNT where ACCOUNTCREATIONDT < ?";
return (Account[]) getPdqTemplate().queryArray(sql,
Account.class);
}

// Other methods goes here

}

Regards,
Venkat-
5 years ago
Dear Experts,

Do we have any open source tools to monitor tomcat memory,garbage collection,http,DB connections etc ?Please advice.Thanks!!!
6 years ago
Dear Experts,

I would like to understand how does multipart/form-data works during file upload scenario's, Does it chunks the data from client to server while transferring the files ?
6 years ago

Nguyen Ninh wrote:Harry Anan, I met the same problem but I don't know how to resolve (Using FileUpload API, Content Management API...).
So, could you give me some code snippet.
Thanks.




Hi Ninh,

I got the same requirement to use the Apache fileupload api to upload large files in MB using HTTP.Could you please suggest any references or source code around.Thanks a lot..
6 years ago

Stefan Evans wrote:Best practice: Use a library to do this.
Apache commons File Upload component can possibly deal with it.



How does the memory management happens while using apache streaming api ?Does it loads the entire Stream object in memory ?when the user uploads a file from the GUI ?.Thanks a lot for the information.
6 years ago
Hi Team,

I need to built a file upload service which should be memory effective.I should avoid loading the entire file into memory,Since I may have multiple http request which will pile up the Heap memory.Can you please suggest the effective way to upload a large file(For ex:1GB file) using http Streaming.I need to do the file upload on a single http call.Let's consider a scenario where 1 GB file to be uploaded using 512MB Heap memory.Not Sure If practically I can achieve this or not.Please advice any best practices.


Appreciate your help..


With Regards,
Silla.
6 years ago