• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to close a CMP Entity Bean

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there
I have a for loop going through an ArrayList of Maps. In each iteration all the data in the map is converted into a new EJB using a custom create method.
The problem is that the java/ejb container/whatever can't keep up and the database connections just mushroom until exceptions are thrown. How do a manually close the bean to free up the resources?
Is the fact that the arraylist might contain over 8,000 maps an issue?
And don't say a word about BMP as this is out of the question!!
At present I have (in shorthand)
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing you can do to "release" a bean. Bean instances are managed by the container and it uses its own set of proprietary algorithms to determine when and which beans should be evicted from memory.
Coming back to your design, if you are inserting 8000 records in a single transaction perhaps you should try to hit the database directly. Entity beans are quite expensive and more so in situations like this one. Have you considered batch inserts using plain old JDBC?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic