java - Stopping the method until another execution finished? -


i have loop adds 50,000 objects arraylist shown below, takes longer time execute.

public list<googlefeedentry> getentries(iterator it) {     googlefeedutil gfu = new googlefeedutil(host, prefix, domain, servername);     list<googlefeedentry> entry = new arraylist<googlefeedentry>();     googlefeedentry gfe;     googlefeedentryshipping shipping;     while (it.hasnext()) {         gfe = new googlefeedentry();         shipping = new googlefeedentryshipping();         productbo product = (productbo) it.next();          entry.add(gfe);     }     return entry; } 

after method calling method

public void dosomething(){          //some code here } 

i calling these 2 methods inside method. if put limited number of objects list working out problem. in case of 50,000 objects throwing following exception

java.sql.sqlexception: maximum open cursors exceeded ora-01000 

i felt nothing oracle(if correct). ofcourse loading objects database.

when set break point @ first method working fine.

how can stop second method until first method executes?

what reason?

you can run method in thread , stop him using wait() , run him later using notify() method.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -