Categories

Main
Database
Java
Microsoft.NET
Adabas
DB2
Informix
Microsoft SQL Server
MySQL
Oracle
Pervasive.SQL
PostgreSQL
Sybase
Other
ASP
ColdFusion
Crystal Reports
Delphi, C etc
JAVA
Microsoft.NET
Perl and the DBI
PHP
ANSI SQL
Unix Shell Scripts
Visual Basic
XML & XSLT
Corel Paradox
FileMaker
Microsoft Access
Microsoft Excel
Other PC Databases
Applications & Tools
Database Concepts & Design
EJB programming & troubleshooting
EJB design
General J2EE
XML & Web services
Web tier: servlets, JSP, Web frameworks
Performance and scalability
Industry news
TSS feedback
Mobicents Contributors
Mobicents Users
JSLEE Resource Adaptor Types
Planning JavaOne 2008
Sun Tech Days
Other Java conferences
Binary Web Services and XML
Metro and JAXB
GlassFish
GlassFish Plugins
Project jMaki
GlassFish WebTier
Mural
Java Development Tools
Java WS & XML Community News
JAXP
Java SE
6uN Early Access
Java Quick Starter
Java SE Snapshots: Project Feedback
JCK Forum
Feedback and Suggestions
JDK Distros
JDK Open Source
General JSR Discussion
JCP 2.6
JXTA Community Forum
ME Interest
ME Cool Apps
ME General Help
ME Feedback & Suggestions
ME Application Developer Interest
Blu-ray Disc Java
ME Developer Days
Squawk
Mobile Developer Alliance
OpenCable
LWUIT
JavaFX Script Language Discussion
OpenJFX General Discussion
Scene Graph
General Performance Discussion
Your Java Career
NetBeans 6.0
Servlets
JSP
JSF
Portals and Portlets
EJB and Other Java EE Technologies
Distributed Java
Object Relational Mapping
JDBC
Web Services
Swing / AWT / SWT / JFace
JNLP and Web Start
Java Micro Edition
Sockets and Internet Protocols
Threads and Synchronization
Performance
Applets
I/O and Streams
Other Java APIs
Game Development
Java in General (beginner)
Java in General (intermediate)
Java in General (advanced)
Programmer Certification (SCJP)
Developer Certification (SCJD)
Associate Certification (SCJA)
Web Component Certification (SCWCD)
EJB Certification (SCBCD)
Mobile Application Certification (SCMAD)
Architect Certification (SCEA)
Web Services Certification (SCDJWS)
XML Certification
Product and Other Certifications
Mock Exam Errata
Sun Certification Results
Authors' Corral
Book Reviews
Events
Bunkhouse Porch
Teachers' Lounge
Testing
OO, Patterns, UML and Refactoring
IDEs, Version Control and other tools
Ant, Maven and Other Build Tools
Linux / UNIX
Mac OS
HTML and JavaScript
XML and Related Technologies
Agile and Other Processes
General Computing
Security
Groovy
Scala
Other Languages
Struts
Application Frameworks
Other Open Source Projects
BEA/Weblogic
IBM/Websphere
Oracle/OAS
Apache/Tomcat
JBoss
Other Java Products and Servers
JavaRanch
Cattle Drive (java college)
Moderators Only
Trash Can
Jobs Offered
Jobs Wanted
Jobs Discussion
Meaningless Drivel
Programming Diversions
Blatant Advertising
Java Announcements
New To Java
Advanced Java
Java Applets
Networking
Threads and Synchronization
Java 2D
AWT / Swing
SWT / JFace
CLDC and MIDP
CDC and Personal Profile
Sun Java Wireless Toolkit
Enterprise JavaBeans
JavaServer Pages (JSP) and JSTL
Java Servlet
JavaServer Faces
Web Frameworks
Database
XML
Lucene
NetBeans
Eclipse
IntelliJ IDEA
JCreator
Other IDEs
Java Tutorials
Java Tips
Jobs Discussion
Jobs Offered
Jobs Wanted
Professional Certification
Forum Lobby
Java Blogs
Introductions
Reviews / Advertising
Suggestions & Feedback

Resources

Java Database
Linux
Coding
Mobile
Hardware
Software Development
Software Development
iOS,OS X
iOS,OS X
ORACLE
IBM DEVELOPER
IBM DEVELOPER
MSDN
MSDN


Tags

EJB programming & troubleshooting

EJB programming & troubleshooting

Problem with removing 2 ejb's that are part of a cmr relatioship


I am on Weblogic 8.1 server, sp2, and SQL Server 2000 for the database.  I am having
a problem getting ejb 2.0 relationships and specifically getting the
deletes to act in the correct order.  I have a B2C (business to consumer) Customer
bean, and Individual CustomerBean.  I set up a uni-directional ejb 2.0 relationship
from Individual bean to B2C bean.  I set up a foreign key reference in the
SQL Server 2000 database, base table of Individual Customer, foreign key field pointing to B2C customer table.
The inserts work correctly, but on delete it fails.  My delete code first ejb
remove's the B2C (child) table then the individual (parent) bean.  The B2C delete
works fine, but for some reason the Individual bean's ejb remove causes -
"DELETE statement conflicted with COLUMN REFERENCE constraint 'FK_B2CIndi
vidualCustomers_IndividualCustomers'. The conflict occurred in database 'Custome
rDB', table 'B2CIndividualCustomers', column 'IndividualCustomerID'."
The database is somehow still seeing that B2C child record, thinking it's now
orphaned, but the ejb remove of the child record (B2C bean) should have removed that
B2C row.  So why does deleting the parent row (Individual bean) cause this?  It might be
a bug in the driver (Opta 2000) I'm using.  The generated SQL code looks like it's
firing in the correct order, so I'm not sure why this is happening.
My ejb-jar.xml relationship setup is -
<ejb-relation>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-relation-name>IndividualCustomer-B2CIndividualCustomer</ejb-relation-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-relationship-role>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-relationship-role-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IndividualCustomer-Has-B2CIndividualCustomer
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ejb-relationship-role-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<multiplicity>one</multiplicity>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<relationship-role-source>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-name>IndividualCustomer</ejb-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</relationship-role-source>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<cmr-field>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<cmr-field-name>b2cIndividualCustomer</cmr-field-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</cmr-field>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ejb-relationship-role>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-relationship-role>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-relationship-role-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B2CIndividualCustomer-IsA-IndividualCustomer
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ejb-relationship-role-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<multiplicity>one</multiplicity>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<relationship-role-source>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ejb-name>B2CIndividualCustomer</ejb-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</relationship-role-source>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</ejb-relationship-role>
My weblogic-rdbms-jar.xml relationship setup is -
<weblogic-rdbms-relation>
&nbsp;&nbsp;&nbsp;&nbsp;<relation-name>IndividualCustomer-B2CIndividualCustomer</relation-name>
&nbsp;&nbsp;&nbsp;&nbsp;<weblogic-relationship-role>
<relationship-role-name>B2CIndividualCustomer-IsA-IndividualCustomer
</relationship-role-name>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<relationship-role-map>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<column-map>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<foreign-key-column>IndividualCustomerID</foreign-key-column>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<key-column>IndividualCustomerID</key-column>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</column-map>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</relationship-role-map>
&nbsp;&nbsp;&nbsp;&nbsp;</weblogic-relationship-role>
&nbsp;&nbsp;</weblogic-rdbms-relation>


Related Links

Local Interface problem on weblogic6.0
Finder Method Error
Need Tool and Methods to testWebApplication Using EJB Technology
looking for classes/package for saving data as a specific file f
I only get the last entity bean updated in a loop
Using XSLT for EJB and other code generation
Subsequent InitialContext calls from one bean to another
List of objects
EJB's over stored procedure
Commit Before Close?
Data Structure to pass data between client tier and app tier
EJB lookup from another EJB server
Diff in SessionBeans between EJB1.1 and EJB2.0
Diff in SessionBeans between EJB1.1 and EJB2.0
The .NET THREAT
Can SilverStream 3.5 call a session bean deployed in WebLogic?