This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Kyle, problem with CMP Entity in Websphere 4.0

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Kyle and everyone
we have a CMP Entity bean which is working in 3.5 but when deployed in 4.0 it is giving error for custom finder methods.
we have a custom finder method and when we call this method it is giving this following error
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.container.UncheckedException: ; nested exception is:
java.lang.Error: Prepared statement does not map to connection
com.ibm.ejs.container.UncheckedException: ; nested exception is:
java.lang.Error: Prepared statement does not map to connection
java.lang.Error: Prepared statement does not map to connection
we feel this is related to the Database connections which the container is getting from datasource but the same thing is working for findByPrimaryKey on the same CMP Entity Bean.
we are not able to resolve the problem pl give some suggestions.
the deployment descriptor is having the following
< finderDescriptors xmi:type="ejbext:FullSelectFinderDescriptor" xmi:id="FullSelectFinderDescriptor_2" selectStatement="SELECT * FROM AFT_ATTR_FILTER T1 WHERE T1.ATTR_FILTER_ID = ?" >
< finderMethodElements xmi:id="MethodElement_6" name="findByAttrFilterID" parms="java.math.BigDecimal" type="Home" >
< enterpriseBean xmi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_2" / >
< /finderMethodElements >
< / finderDescriptors >
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, first of all, don't use a full select if you can avoid it -- just use a where clause finder instead. My workbook describes how this is done. If you're really just selecting based on one attribute, then a where clause finder should work. My guess is that 4.0 is a bit more sensitive to the order of columns returned than 3.5 was.
Kyle
 
Kiran Kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i modified my ibm-ext.xmi file to have the whereClause descriptor. but again this also is giving the same error.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.container.UncheckedException: ; nested exception is:
java.lang.Error: Prepared statement does not map to connection
com.ibm.ejs.container.UncheckedException: ; nested exception is:
java.lang.Error: Prepared statement does not map to connection
java.lang.Error: Prepared statement does not map to connection
the following is my ext.xmi file which is having my descriptor

< finderDescriptors xmi:type="ejbext:WhereClauseFinderDescriptor" xmi:id="WhereClauseFinderDescriptor_1" whereClause="T1.ATTR_FILTER_ID = ?" >
< finderMethodElements xmi:id="MethodElement_3" name="findAfg_attr_filter_groupByAft_attr_filter" parms="com.attrfilter.Aft_attr_filterKey" type="Home" >
< enterpriseBean xmi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_1" / >
< / finderMethodElements >
< / finderDescriptors >

could u pl suggest a work around for this. we are not able to solve. we did all this after reading your work book but still getting the same error.
but it is not giving any error when we call findByPrimaryKey method on the bean

thanks and regards
kiran
 
Kiran Kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
could anyone pl try to help me in this. we are really going behind schedule becoz of this and we have to decide whether to continue with this or to go in for a design change.
thanks and regards
kiran
 
Kiran Kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
i am able to solve the problem.
there was problem with the order of the CMP fields and the order of the columns in the database table.
thanks for your help
regards
kiran
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic