on 02-07-2006 9:21 AM
Hello,
I am looking for examples where JCO is used to implement
bean managed persistence of entity beans.
Has anybody tried this before?
Best regards
Bernd Rödel
Hi,
why do you want to use a Entity Bean ? Just to get the advantages of ejbLoad() / ejbStore() syncronization ?
I have implemented it with Stateful Session Bean which is no big deal. I will send you the code if u like.
Regards
Matthias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem has been solved. JCO and BMP can be combined.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
to my opinion you might (!!) end up in trouble using BMPoverJCO but it might be worth a try.
Within ejbCreate you have to return the primary key to let the container know how to get the object/data further on. This is stored within the EJBContext (and could/should be get from there).
Take care for the ejbPostCreate as the PK is assigned AFTER ejbCreate.
Any synchronizing by ejbLoad/ejbStore - which is invoked by the container solely - uses this PK.
So override these methods and look what happens.
As you could not make use of a DataSource, I would encapsulate the connection to SAP elsewhere but not within the BMP EJB (you might end up in hundreds of connections to SAP, depending on EJB instances. JCO offers a Pool which is easy to implement. I could provide you with more details on this.
BTW, let me know if you succeeded
Regards
M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried with BMP, but I get an deployment error. Do you have any clues ?
Thanks in advance
Bernd
5#000E9BAED2030054000000120000087800040C26CB122447#1139260662001#com.sap.engine.services.deploy##com.sap.engine.services.deploy#Administrator#614#####SAPEngine_Application_Thread[impl:3]_35##0#0#Error#1#/System/Server#Java#deploy_5029##Exception in operation deploy with application sap.com/PersistenceEAR.#2#deploy#sap.com/PersistenceEAR#
#1.5#000E9BAED2030054000000130000087800040C26CB122E87#1139260662001#com.sap.engine.services.deploy##com.sap.engine.services.deploy#Administrator#614#####SAPEngine_Application_Thread[impl:3]_35##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception in operation deploy with application sap.com/PersistenceEAR.
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.rollbackPart(ApplicationTransaction.java:387)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:292)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:323)
at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3027)
at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:467)
at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1555)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Cannot deploy application sap.com/PersistenceEAR.
at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:395)
at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:307)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:290)
... 13 more
Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during generation of components of application sap.com/PersistenceEAR in container EJBContainer.
at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:609)
at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:386)
... 15 more
Caused by: java.lang.ClassCastException
at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.processEntity(EJBJarParser.java:291)
at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.processBeans(EJBJarParser.java:206)
at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.parseXml(EJBJarParser.java:152)
at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.parseXml(EJBJarParser.java:97)
at com.sap.engine.services.ejb.deploy.DeployAdmin.parseSingleJar(DeployAdmin.java:297)
at com.sap.engine.services.ejb.deploy.DeployAdmin.generate(DeployAdmin.java:247)
at com.sap.engine.services.ejb.EJBAdmin.deploy(EJBAdmin.java:2133)
at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:603)
... 16 more
To your exceptions:
No idea at all ! Are you sure about correct ejb-jar.xml; what did you say about the PK in there (i.e. <prim-key-class>java.lang.Integer</prim-key-class> FULLY QUALIFIED class name ?
Did you try to deploy on i.e. JBoss (phsst) ? I had the phenomenon that sth. not deployable using JCo on WebAS Sneak Preview works fine with other vendors without any change (aside of DDs).
That does not help you directly in this case but could give a hint where to look for the problem.
Anyway, SLSB or SFSB still might be well worth to take into consideration.
Regards
Matthias
Quite interesting... Could you please tell me where you found these examples ? JCO is considered here as back-end for BMP ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.