Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem with Transaction Timeout

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends
i facing a peculiar problem,
i am having CMR with one to many cardinality
here is the piece of code
Collection stackZonePKs = _zoneService.findPKsByParent(rowZone);
System.out.println("YardConfigurationServiceBean 4:: RowID"+aRowId);

for (Iterator i = stackZonePKs.iterator(); i.hasNext()
{
Zone stackZone = _zoneService.findById(((BigDecimal) i.next()).toString());
System.out.println("YardConfigurationServiceBean 6:: RowID"+stackZone.getName());
stackZone.remove();
}
in the code what i am doing is i am deleting all the child node or rows in the table getting the collections of primarykeys to remove the main node
what is happening is the transaction is getting timed out before deleting all the child nodes and the transaction is getting rolled back as a result of it can u please suggest me how t rectify this problem
i am using weblogic 7.0
Thanks in advnace
Ravi.I
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why aren't you using Cascading delete in the EJB deployment descriptor?
Kyle
 
ravi inguva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh sorry i missed a point actually it is many - many relation not one to many
and the ejb-jar documentation says as follows
<!--
The cascade-delete element specifies that, within a particular
relationship, the lifetime of one or more entity beans is dependent
upon the lifetime of another entity bean. The cascade-delete element
can only be specified for an ejb-relationship-role element contained
in an ejb-relation element in which the other ejb-relationship-role
element specifies a multiplicity of One.
Used in: ejb-relationship-role
-->
<!ELEMENT cascade-delete EMPTY>
--------------------------------------------------
now how should i go about this
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yeah, the fact that it's many-to-many does make a difference.
I'd either rachet up your transaction timeout or (probably a better solution) handle the deletes outside of the Entity beans with a more optimized SQL statement you call from a Session bean (which we had to do a lot in EJB 1.1. prior to the introduction of CMR).
Kyle
 
ravi inguva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle for your optimum solution
-Ravi
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic