CMP and Transaction Attribute
Hi All!
I try to play with cmp entity beans. All I try to do is find instance and call one from the methods.
When I use transaction attribute another than "Required", I get exception 25222. Application module creation exception.
If I change attribute to "Required New" then I get error while bean try to UPDATE record.
I can't understand why this update appear on findByPrimaryKey!
Can any body give some information on JBO behavior?
Mike
null
I do one more test and found
UPDATE exception raised when I have foreign key in table. If I use only plain fild evething is ok. If add to entity foreign key field container raise exception when it try to update record.
Similar Messages
-
Compound attribute and transactional attribute
hi experts,
what is compound attribute and transactional attribute, in what case we will use this attributes, can anybody explain with business scenario, pl help to understand this.
thanks & regards
venkatCoumpounding attributes is an attribute which is compounded with another infoobject. This brings unique data relationship. Suppose u have company codes like CC1, CC2, CC3 and you have employees E1, E2, E3...The employees codes will be same in each company code. To make them unique across we compound the employeee code with company code. The it will result as below.
CC1 - E1, E2, E3
CC2 - E1, E2, E3
CC3 - E1, E2, E3
Again the other one must be a transitive attribute and not transactional attribute. When an navigational acts as another attribute as navigational attribute then the other is called transitive attribute. -
I got two ReadOnly CMP entity beans with a 1:N relationship, and one session facade,
all with the TX attribute of NotSupported. When I tried to get the CMR collection
in the session bean, WebLogic 6.1 SP3 threw an EJBException saying the CMR collection
could not be accessed outside a TX context. Only by changing the TX attribute
of the SLSB to Required (left the CMP bean TX attribute unchanged) could I get
the collection. What is the reason behind this behavior? I want the caching
feature of the ReadOnly beans but do not want ot pay any price for transactions.
Is this possible?I do one more test and found
UPDATE exception raised when I have foreign key in table. If I use only plain fild evething is ok. If add to entity foreign key field container raise exception when it try to update record. -
Hello,
I've got some weird behaviour happening on my finders.
I've got a CMP bean and a Session bean on top of it.
The session bean has a method that performs the following:
1 - creates an instance of the CMP bean
2 - updates an attribute on this instance of the CMP
3 - perform another find on the CMP.
Now the first 2 steps are ok. The 3rd step is a problem.
If I do a find by PK then it works.
But if I perform a custom finder that specifies one of the attributes that was updated in step 3, (eg, age=1, where age is an attribute on the CMP etc), then it doesn't return the CMP.
If I retrieve the bean at this point in time through a find by PK and check the updated attribute, it returns the updated value.
So it is as if the custom finder is some how executed in a different transaction from the rest of the method, as it doesn't see the fact that I've updated the attribute in step 2.
Note that if I call the custom finder in step 1, after creation, it works properly.
I've got the transaction attribute on the session bean to Requires and all the entity bean methods are set to Requires.
BTW, I'm using OC4J 1.0.2.2.1.
Any ideas,
Thanks!!!,
RickyHi Murtaza,
Since you are posting your question to this forum, I will assume that you are using OC4J.
Although I haven't tried it myself, you can define the SQL to be performed by your "finder" method in the "orion-ejb-jar.xml" file. If you do that, then you shouldn't use EJB-QL, since defining the (SQL) query in "orion-ejb-jar.xml" is intended to be used instead of EJB-QL.
If I understand you correctly, then your SQL should be something like this:
select
from
YOUR_TABLE
where
ID1 = nvl('id1', ID1)
and
ID2 = nvl('id2', ID2)
and
ID3 = nvl('id3', ID3)You will find information on "orion-ejb-jar.xml" at the following Web sites (not in any particular order):
http://technet.oracle.com/tech/java/oc4j/content.html
http://www.orionserver.com
http://www.orionsupport.com
http://www.atlassian.com
http://www.elephantwalker.com
Hope this helps you.
Good Luck,
Avi.
P.S. By the way, perhaps you will agree to award me the "Duke Dollars" you are offering for this question that you also asked in the Java Developer Connection (JDC) forums? -
hi,erveryone,
one difficult question need help.
Environment: WLS8.1sp2 + WLI8.1sp2 + ORACLE9i + solaris9
when I started archiver manually,just for a while, wli system generated about 40,000 JMS messages in
wli.internal.worklist.timer.queue,and consume the great mass of system resource of Database server,I had to stop these
archive processes immediately to keep other applicaitons which using the same database running normal. I did so by
following steps:
(1) in WLI console, delete wli.internal.worklist.timer.queue;
(2) in WLI console, reconstruct wli.internal.worklist.timer.queue;
(3) restart wli server.
after server was restarted, wli server output endless and repeatly exception to log file ,the typical exception was:
####<May 8, 2005 3:08:26 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '54' for queue:
'weblogic.kernel.Default'> <<anonymous>> <BEA1-54B26B551CC1A8856F80> <BEA-010049> <EJB Exception in method: remove:
java.sql.SQLException: Transaction rolled back: Unknown reason.
java.sql.SQLException: Transaction rolled back: Unknown reason
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1299)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_loadGroup0(ListenerBean_1nsp14__WebLogic_CMP_R
DBMS.java:1055)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
Logic_CMP_RDBMS.java:596)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
Logic_CMP_RDBMS.java:584)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.ejbRemove(ListenerBean_1nsp14__WebLogic_CMP_RDBMS.j
ava:2423)
at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1318)
at weblogic.ejb20.internal.EntityEJBLocalHome.remove(EntityEJBLocalHome.java:214)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14_LocalHomeImpl.remove(ListenerBean_1nsp14_LocalHomeImpl.java:131)
at
com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean.removeTaskListeners(RemoteWorklistManagerBean.java:3001)
at
com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean_us8t1c_EOImpl.removeTaskListeners(RemoteWorklistManagerBean_us8t
1c_EOImpl.java:698)
at com.bea.wli.worklist.timer.WorklistTimerMDB.processListenerToRemove(WorklistTimerMDB.java:102)
at com.bea.wli.worklist.timer.WorklistTimerMDB.onMessage(WorklistTimerMDB.java:61)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
####<May 8, 2005 3:08:26 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '96' for queue:
'weblogic.kernel.Default'> <<anonymous>> <BEA1-54B96B551CC1A8856F80> <BEA-010049> <EJB Exception in method: remove:
javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found..
javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found.
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_loadGroup0(ListenerBean_1nsp14__WebLogic_CMP_R
DBMS.java:1165)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
Logic_CMP_RDBMS.java:596)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
Logic_CMP_RDBMS.java:584)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.ejbRemove(ListenerBean_1nsp14__WebLogic_CMP_RDBMS.j
ava:2423)
at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1318)
at weblogic.ejb20.internal.EntityEJBLocalHome.remove(EntityEJBLocalHome.java:214)
at
com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14_LocalHomeImpl.remove(ListenerBean_1nsp14_LocalHomeImpl.java:131)
at
com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean.removeTaskListeners(RemoteWorklistManagerBean.java:3001)
at
com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean_us8t1c_EOImpl.removeTaskListeners(RemoteWorklistManagerBean_us8t
1c_EOImpl.java:698)
at com.bea.wli.worklist.timer.WorklistTimerMDB.processListenerToRemove(WorklistTimerMDB.java:102)
at com.bea.wli.worklist.timer.WorklistTimerMDB.onMessage(WorklistTimerMDB.java:61)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
The wli server generated log file very quickly ,:it can output 1M bytes log file per second,all logged information
is similar to the <BEA-010049> excetpion metioned above. BEA support engineer suggested me to totally stop the
archive ,I did so,but the server was still ouput the log file like crazy as before and the normal log information are
completely override by <BEA-010049> excetpion.
I checked the EntityEJBs in WLI console :Mywlidomain> Applications> WLI System EJBs> WLI Worklist Persistence$)A#,and
found that in statistics table :
ListenerBean : Pool miss ratio = 99.67%, transaction rollback ration = 99.90%,Destory Bean Ratio = 99.48%(see
attachment)
WorklistTimerMDB: transaction rollback ratio = 99.97%
It seems ListenerBean worked incorrectly.I searched in support.bea.com and found one example which also about server
output endless log file,the author solved this problem by changing Bean's transaction-attribute from 'Required'
to 'RequiresNew' thought he didn't know why it works. I try this method by changing ListenerBean's
transaction-attribute from 'Required' to 'RequiresNew'.
$weblogic_home/integration/lib/wli-ejbs.ear/ejb-jar-generic.xml:
<ejb-name>CommentBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>ListenerBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute> -----------the default value is Required,I modified it to
RequiresNew.
</container-transaction>
<container-transaction>
really it works, the log file output resume normal. But there are still some problems:
(1) this exception is still exist:
javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found.
(2) is this method safe ?(Does "Modify ListenBean's transaction-attribute" impat other parts of wli system?)
(3) after changed the transaction attribute, if turn on archive again, the server output endless exception:
####<Jun 1, 2005 5:14:58 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '63' for queue:
'weblogic.kernel.Default'> <<anonymous>> <BEA1-2F43890B86B0A8856F80> <BEA-010036> <Exception from ejbStore:
java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start()
failed on resource 'weblogic.jdbc.jta.DataSource': XAER_RMERR : A resource manager error has occured in the transaction
branch
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1160)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
at weblogic.jdbc.jta.DataSource.start(DataSource.java:617)
at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1075)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:218)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1287)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
6)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start()
failed on resource 'weblogic.jdbc.jta.DataSource': XAER_RMERR : A resource manager error has occured in the transaction
branch
oracle.jdbc.xa.OracleXAException
at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1160)
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
at weblogic.jdbc.jta.DataSource.start(DataSource.java:617)
at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1075)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:218)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1287)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
6)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1292)
at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
6)
at
com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
How can I solve these problem ? any suggestion is warm welcome.
Thanks in advance.
Great LouBack up all data to at least two different storage devices, if you haven't already done so. The backups can be made with Time Machine or with a mirroring tool such as Carbon Copy Cloner. Preferably both.
Boot into Recovery (command-R at startup), launch Disk Utility, and erase the startup volume with the default options.This operation will destroy all data on the volume, so you had be better be sure of your backups. Quit Disk Utility and install OS X. When you reboot, you'll be prompted to go through the initial setup process. That’s when you transfer the data from one of your backups. For details of how this works, see here:
Using Setup Assistant
Transfer only "Users" and "Settings" – not "Applications" or "Other files." Don't transfer the Guest account, if it was enabled on the old system. Test. If the problem is still there, you have a hardware fault. Take the machine to an Apple Store for diagnosis.
If the problem is resolved, reinstall your third-party software cautiously. Self-contained applications that install into the Applications folder by drag-and-drop or download from the App Store are safe. Anything that comes packaged as an installer or that prompts for an administrator password is suspect, and you must test thoroughly after reinstalling each such item to make sure you haven't restored the problem.
Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication. -
Assignment of transaction attributes in ejb-jar.xml
Hi all,
I'm going through the employee example from the book "Java programming in SAP web application server". I have followed the instrucstions to the letter and have triple checked that i did not miss anything.
During the part "Defining Transaction Control", when i go to the "Assembly" tab, choose "Container-transaction" and click add; i get the following error message.
You have to create and reference EJBs first. Afterwards you can choose them here.
Newly created EJBs are referenced automatically in the ejb-jar.xml, in special cases you might have to reference them manually.
Below is a copy of the ejb-jar. Both beans are referenced in the file so i don't really understand the error message!
Thanks for your help.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>EmployeeServicesBean</ejb-name>
<home>com.sap.demo.EmployeeServicesHome</home>
<remote>com.sap.demo.EmployeeServices</remote>
<local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
<local>com.sap.demo.EmployeeServicesLocal</local>
<ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Employee</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
</ejb-local-ref>
</session>
<entity>
<ejb-name>EmployeeBean</ejb-name>
<home>com.sap.demo.EmployeeHome</home>
<remote>com.sap.demo.Employee</remote>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-class>com.sap.demo.EmployeeBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>EmployeeBean</abstract-schema-name>
<cmp-field>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>department</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<description>Query for getting all employee objects.</description>
<query-method>
<method-name>findAllEmployees</method-name>
<method-params/>
</query-method>
<ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor/>
</ejb-jar>I was able to add the transaction attributes manually to the ejb-jar.xml file. below is what the file looks like now for those interested.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>EmployeeServicesBean</ejb-name>
<home>com.sap.demo.EmployeeServicesHome</home>
<remote>com.sap.demo.EmployeeServices</remote>
<local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
<local>com.sap.demo.EmployeeServicesLocal</local>
<ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Employee</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
</ejb-local-ref>
</session>
<entity>
<ejb-name>EmployeeBean</ejb-name>
<home>com.sap.demo.EmployeeHome</home>
<remote>com.sap.demo.Employee</remote>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-class>com.sap.demo.EmployeeBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>EmployeeBean</abstract-schema-name>
<cmp-field>
<description>
</description>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>department</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<description>Query to get all employee objects.</description>
<query-method>
<method-name>findAllEmployees</method-name>
<method-params/>
</query-method>
<ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<description>container-transaction</description>
<method>
<ejb-name>EmployeeBean</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>EmployeeServicesBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Thanks -
Transaction attribute in XML deployment descriptor
Hi,
I just want to know the use of transaction attributes like (Required, notSuuport etc..) are in the EJB.
What is Bean managed and container managed transaction.
How we use the transaction attributes in BMP and CMP.
and in similar fashion, the use of the same in Session beans.
..Amanmodification to the above quesion::
There are 5 different beans named as
CMP, BMP, Stateless, Stateful and MDB.
I want to know that which all transactions (CMT or BMT) can be applied for which bean?
I just got some feedback from some ppl that i cant apply BMT for CMP and BMP. if that is true then why???
if i can apply CMT for CMP and BMP then how i will modify the EJB-jar for the
method definitiion for CMP and BMP. I mean to say the method name and parameter definition. as there are only call back methods.
..Aman -
Default Transaction Attribute for EJBs
Guys,
Can you tell me the default transaction attributes if any in Weblogic 7.0 i.e.
the attributes used
if not explicitly specified for a bean method when using in CMT ?
For CMP entity beans,
MDBs,
Other beans (?) :
thanks for your help
regards
VedHello Mr. Woollen,
As always, thank you for your excellent insight into the internals of BEA WebLogic.
I now have a better understanding of what happens "by default" in WLS. I do agree
that changing this now would definitely break existing applications. It's always
difficult to decide when to officially deprecate a "feature" or to leave it in
forever.
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
Rob Woollen <[email protected]> wrote:
For better or worse, MDBs default to NotSupported and everything else
defaults to Supports.
I say for better or worse because I would have liked to change it to
always require the user to set a default transaction attribute.
Unfortunately we have many customer's applications who depend on this
behavior, and I believe if we change it we will break all of them.
Regardless, I would not recommend depending on our default tx attribute
and instead always set one for '*'.
In general, entity beans should run as Required or Mandatory. Session
beans are usually required or notsupported. MDBs are required or
notsupported.
-- Rob
Ved Gangaputra wrote:
Guys,
Can you tell me the default transaction attributes if any in Weblogic7.0 i.e.
the attributes used
if not explicitly specified for a bean method when using in CMT ?
For CMP entity beans,
MDBs,
Other beans (?) :
thanks for your help
regards
Ved -
If an entity bean (CMP v2) has its transaction attrib "supports", why
when a client (ejb/servlet/jsp) calls its business methods does WLS
call ejbLoad() before every method call? Note that the calls do not
occur inside a transaction!
This is not intuitive to me. I would think that ejbLoad() would be
called once when the bean is activated and then all business methods would
access that data.
Note that if you put the entity bean behind a session bean with a
transaction attrib "Required", then the ejbLoad() gets called once no
matter how many business methods are called from the session bean.
This is (obivously) correct.
Why is this relevant? The latest java petstore demo essentially calls
EJBLocal's from jsp (via taglib's) - I guess no different from WLS
EJB to taglib product - where the fine grained getter methods are
called. From what I gather, this means that every one of the jsp
get methods results in a database read! This can't be right!
What am I missing? As above, if the entity bean has "supports"
and is called from a jsp, it appears that ejbLoad()/ejbStore()
would be called for every jsp taglib invocation.
Glenn"Glenn R. Kronschnabl" wrote:
Rob,
Thanks for your reply. This implies that even EJBLocals with fine
grained getter methods should never be used outside a tx scope.Yes, unless you are using Read-Only entity beans which cache data for longer
periods of time.
Even
though you bypass the RMI semantics, you'll be killed by the local tx.
Which to me says that using EJB's from JSP (even via tags) is a bad
idea because each getter method will result in a database read/write,
(unless you go with a readonly EJB as you stated).
Accessing transactional entity beans via tags is probably a bit off. You
could start the tx in the JSP or the tag library, but I don't really like
that pattern much. I prefer making the tags more coarse-grained and having
the tags talk to a stateless session bean which in turn talks to the entity
beans.
>
Unfortunately, I've been seeing some threads on the net advocating
using EJBLocals with tx=supports because one of the most common
patterns has session beans (where you can specify your desired tx)
in front of entity beans (so you're set methods are protected via
the session bean tx),RIght, I think Required or Mandatory is a better choice for the entity beans
here.
but then you can use the EJBLocal (via tags)
on a JSP page (no tx) to view the data via fine grained getter
methods.Other than the performance issues, I dislike this because it exposes the
entity bean directly to the JSP. If I have to go through an interface (the
session bean) to access the entity bean, then I shouldn't have another route
to access the entity bean directly.
-- Rob
>
As you state, this is a disaster because each getter method
will run in a local tx, requiring a database read/write. Oouch!
Glenn
On Thu, 06 Dec 2001 17:08:07 -0600, Rob Woollen wrote:
First off, I wouldn't recommend that you ever run any EJB with the
'supports' transaction attribute. If you want transactional behavior
use Required, RequiresNew, or Mandatory. If you want to run in an
unspecified tx, use NotSupported or Never.
WLS runs entity beans with an unspecified tx in their own local tx.
That's why you see the reads and writes on the method call boundary.
Your scheme of only reading when the bean is activated could make the
bean's data out of sync with the underlying database. That's acceptable
in many cases, and that's why we have the Read-Only entity bean option.
It gives you exactly what you'd like.
-- Rob
"Glenn R. Kronschnabl" wrote:
If an entity bean (CMP v2) has its transaction attrib "supports", why
when a client (ejb/servlet/jsp) calls its business methods does WLS
call ejbLoad() before every method call? Note that the calls do
not occur inside a transaction!
This is not intuitive to me. I would think that ejbLoad() would be
called once when the bean is activated and then all business methods
would access that data.
Note that if you put the entity bean behind a session bean with a
transaction attrib "Required", then the ejbLoad() gets called once no
matter how many business methods are called from the session bean. This
is (obivously) correct.
Why is this relevant? The latest java petstore demo essentially calls
EJBLocal's from jsp (via taglib's) - I guess no different from WLS EJB
to taglib product - where the fine grained getter methods are called.
From what I gather, this means that every one of the jsp get methods
results in a database read! This can't be right! What am I missing? As
above, if the entity bean has "supports" and is called from a jsp, it
appears that ejbLoad()/ejbStore() would be called for every jsp taglib
invocation.
Glenn
AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnWebLogic.com
[att1.html] -
Can Entity Bean be set with "RequiresNew" transaction Attribute?
I find it result in "dead lock"
when I call RequiresNew attributed CMP method in session Bean.
Then, Is it possible to use CMP which is set with "RequiresNew" transaction attribute?
I Wonder why.
Thanx in advance.
Requires-new makes the container start a new transaction. Only use that flag
at the point that you are certain that a NEW transaction should BEGIN. I
suggest you use Required as your default for all methods in the application,
and only change that to anything else when you are certain that you should.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"A.J,LEE" <[email protected]> wrote in message
news:3ba5adb2$[email protected]..
>
> I find it result in "dead lock"
> when I call RequiresNew attributed CMP method in session Bean.
> Then, Is it possible to use CMP which is set with "RequiresNew"
transaction attribute?
>
> I Wonder why.
>
> Thanx in advance.
-
Diff B/W master data and transaction data
Hi all,
What is the main Diff B/W master data and transaction data. give me some example ?
Thanks in Advance
Krish...hi krish,
MASTER Data is the data that exists in the organization like employee details, material master, customer master, vendor master etc. These are generally created once.
Master data are distributed throughout the company, they are often not standardised and often redundant. As a result it is very costly to offer efficient customer service, keep track of supply chains and make strategic decisions. With SAP Master Data Management (SAP MDM) these important business data from across the company can be brought together, harmonised and made accessible to all staff and business partners. As a key component of SAP NetWeaver, SAP MDM ensures data integrity via all IT systems.
Regardless of the industry, companies often work with different ERP and Legacy systems. The result: the business processes are based on information about customers, partners and products which is displayed in different ways in the systems. If the data are recorded manually, there are more inconsistencies: some data sets are entered several times, others cannot be retrieved by all divisions of the company.
As corporate applications are becoming increasingly complex and produce ever greater amounts of data, the problem is intensified further. Nevertheless, your employees must work with the inconsistent data and make decisions on this basis. The lack of standardised master data easily leads to wrong decisions, which restrict efficiency and threaten customer satisfaction and profitability.
In a word: in order to save costs and ensure your companys success it is necessary to consolidate master data about customers, partners and products, make them available to all employees beyond system boundaries and use attributes valid company-wide for the purpose of description.
TRASNACTION Data - These are the business documents that you create using the master data - Purchase orders, sales orders etc
http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/193e4045796913e10000000a1550b0/content.htm
Regards,
GNK. -
Is there a special reason why NotSupported and Required are the only two supported transaction attributes? I understand that MDBs cannot have a client-initiated transaction, but there are other transaction attributes that indicate the same thing.
If an MDB wants to indicate that it should not execute in a transaction, why can't it indicate Never or Supports in addition to NotSupported? In the case of no client-initiated transaction, all three result in the annotated method occuring under no transaction.
If an MDB wants to indicate that it should execute in a transaction, why can't it indicate RequiresNew in addition to Required? Again, in the case of no client-initiated transaction, both result in the annotated method occuring under a transaction.
The Mandatory attribute throws an exception if there is no client-initiated transaction, so clearly that is never appropriate for MDBs. But I am confused as to why the other transaction attributes cannot be used as indicated above.
Please clarify why the specification indicates this about MDB transaction attributes...
Thanks.When ejb webservice endpoints were introduced in J2EE 1.4 there was no support for
propagation of transaction context over a webservice invocation. Both the JSR 109
spec and the EJB 2.1 spec prohibited the use of MANDATORY on an ejb web
service endpoint since using it was likely a developer error.
In Java EE 5 the restriction against MANDATORY for ejb web service endpoints was removed in the
EJB 3.0 spec. There's still no requirement that transactions be able to flow with web service
invocations but there are some products that support it so the ejb container is no longer
required to throw an exception in that case.
--ken -
why transaction attributes are not present in JDBC ?
EJB 2.0 Specification includes six defined transaction attributes but JDBC does not carry these . Even the latest JDBC spec does not carry these attributes . Why ?gimbal2 wrote:
YoungWinston wrote:
user575089 wrote:
EJB 2.0 Specification includes six defined transaction attributes but JDBC does not carry these . Even the latest JDBC spec does not carry these attributes . Why ?I don't know, but I suspect that the transaction attributes are only relevant to EJB. JDBC can be used to execute any piece of SQL on a database, and therefore doesn't have any "model" associated with it (although it does allow you to disable auto-commit). I'm no EJB expert, but I''d suspect that it probably does have a transaction model.
WinstonYes, with exactly six transaction attributes. That is because those attributes are not related to JDBC but to container managed transactions; in other words EJB tech.correct. These are available in EJB tech. However,my point was these are evolved because of necessity ... is not it ? -
What happens internally while loading master data and transaction?
hello,
What happens internally and which tables are used while loading master data and transaction?
I have loaded the data in DSO, but i am not getting value of particular InfoObject after loading the data.
I have executed Attribute change run also.
Kindly explain ...
Thanks,
SonuHi,
Master data,
Material Indipendent data can be sent without any dependency.
Material Dependent data sequence is as follow.
Plant,
MRP areas,
Supply area,
Material,
MRP area material,
planning material,
ATP check,
Purchase info recards,
schedule agg,
PPM or PDS (But before PPM or PDS work center should send to apo) If PDS is sending then BOM should send before PDS.
Transaction data.
As per the business requirement what is planning in apo.
Regards,
Kishore Reddy. -
Transaction Attribute issue in weblogic 8.1
Hi,
I have problem with the transaction attribute of my session bean in Weblogic8.1 and SQLServer. Following is the description.
I have two beans, say SampleBeanOne and SampleBeanTwo. The transaction attribute of SampleBeanOne is "Required" and that of the SampleBeanTwo is "RequiresNew".
In SampleBeanOne i am trying the execute the a batch of insert quires using PreparedStatement.addBach() and PreparedStatement.executBatch() in a loop that runs of 5 times.
Inside the loop i am calling a method in SampleBeanTwo to get the next sequence. In that method i am updating the squence and selecting the new value.
Now the problem i am facing is that when i call the executeBatch() in the PreparedStatement only the final insert statement added to the batch is called and the insert statement added gets vanished.
If i change the transaction attribute of the SampleBeanTwo to "Required" the code is working fine. But i can't do that since the SampleBeanTwo is accessed throught out my application.
The same peace of code is working properly with Websphere5 and SQL server combination.
Kindly help me out in this issue.
RegardsHi
ThanX for your reply. I raised the issue to the BEA support, they said that the issue is the driver that i am using. It got resolved when i tried with the BEA provided driver. They call it the BEA branded driver for SQL Server.
Regards
Muthu
Maybe you are looking for
-
I'd like to get iWork on both my ipad 2 and iphone 4 mainly for traveling purposes... Right now I lent my iPad to my dad whose in somewhere else now so I don't have access to the iPad. So, I was wondering if right now I buy iWork onto my iPhone, and
-
Why is Bridge CC so slow?
I'm trying to figure out a way to diagnose why Bridge CC is so slow. I regularly use programs like Photoshop, Lightroom and Premiere and don't notice any kind of inapropriate lag or delays at all. However, when working in Bridge it just feels slow. O
-
Exporting files from InDesign to correct size
Hi, Hope someone can help. I create multiple ads for many publications and have joboptions set up for each. Brill, saves loads of time! However, some require the ad to be cropped to bleed size but still include crop marks. How can I export a PDF to t
-
"Activation Limit Reached" - I Have Since Retired and Computer No Longer Available
I previously purchased CS3 Design Premium and installed on computers where I worked. I've since retired and left the company, but before leaving I uninstalled all software that I had personally purchased (unfortunately, without deactivation). It has
-
Question on MacBook Pro (Late 2006) and OS X 10.5
I've owned the MacBook Pro I am currently using since April 2006. The specs for the system are as follows: Hardware Overview: Model Name: MacBook Pro 15" Model Identifier: MacBookPro1,1 Processor Name: Intel Core Duo Processor Speed: