• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

lock method

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when I am calling lock(recNo) on locked record my code is blocking for some time and after some time it throws
java.lang.OutOfMemoryError: Java heap space .Like it goes in infinite loop in lock method .

Is it okay when we call lock method on already locked record it should block the code.


let me know
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi;

Is it okay when we call lock method on already locked record it should block the code.



I think the answer is yes for this question, the current thread will be blocked when you call the wait or aWait on some object or lock .

but for

when I am calling lock(recNo) on locked record my code is blocking for some time and after some time it throws
java.lang.OutOfMemoryError: Java heap space .Like it goes in infinite loop in lock method .



actually i don't know why you received it.

Best Regards.
Mohamed Darim
SCJP, SCJD in progress ... (from 1/8/2007 - till now ....)
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll probably have to post some code in order to see why it's going out of memory. Otherwise we can't tell what is wrong with your code. It should not behave like this.
 
Legend has it that if you rub the right tiny ad, a genie comes out.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic