• 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

Problem with Transaction Timeout

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kyle for your optimum solution
-Ravi
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic