EJB 2 : Query in understanding Transaction Attribute NotSupported
NotSupported
The Container invokes an enterprise Bean method whose transaction attribute is set to NotSupported with an unspecified transaction context.
I am having a query in understanding the above thing .Please let me know what does above mean and also what transaction context mean in the below :
If a client calls with a transaction context, the container SUSPENDS the association of the transaction context with the current thread before invoking the enterprise bean's business method.
Thanks in advance .
Waiting for your replies .
it means that the method must operate outside of an active transaction - in other words there will be no active transaction during its runtime. If there is an active transaction when the method is called, that transaction is "put on hold" until the "notsupported" EJB call finishes.
Similar Messages
-
EJB + "transaction attributes" + "best practice"
hi
For EJBs, when you specify multiple transaction attributes for a single
method, is the latest attribute taken or the first?
for e.g. In Jbuilder8 in the container transaction section for an EJB,
if i were to put
Method Transaction attribute
* Required
getSomeThing() Supported
As you can see all the methods were initially given the required attribute,
and then the method getSomeThing() was given Supported. will the
getSomething() method use Required or else Supported. Secondly, will this
cause an extra overload (Transaction attributes are set and the again
reset), is it a recommended best practice?
surengetSomeThing() Supported
As you can see all the methods were initially given
the required attribute,
and then the method getSomeThing() was given
Supported. will the
getSomething() method use Required or else Supported.It will use supported.
Secondly, will this
cause an extra overload (Transaction attributes are
set and the againIt won't cause extra overload.
reset), is it a recommended best practice?It really depends on your needs - what you're trying to achieve. There is no best practice for that it depends on the application you're building.
Regards,
Dimitar -
Regarding EJB transaction attributes
Hi,
I am having a method in a stateless session bean. This bean's transaction
attribute is "Required'. This method in turn is calling a create method using another entity bean whose transaction attribute is "Required".
After calling the create method we are using another stateless session bean
having transaction attribute "NotSupported" to retrieve the previously created record(We have our own business requirement, that's the reason we are using here another session bean to retrieve immediatly the created record, instead of using the same entity bean). All the above transactions are done in the same method.
while calling the retrive method to retrieve the immediatly created record, we are getting an exception saying the below.
SQL0911N The current transaction has been rolled back because of
a deadlock or timeout. Reason code "68".
What could be the problem? Can anyone help me out?
Note : if we use a different method for the retrieval alone then it's working fine.
Thanks.The container might have suspended the current transaction, and called the retrieve method whose tx attribute is NotSupported. The duration of this invocation may have exceeded the transaction timeout limit. After the transaction has been left idle for such a long period, it times out.
-
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 -
We are using Ejbs2.1
Our system uses Database but we are not writing IT System so we do not need To use trasactions at all.
We are using RequiresNew as the Transaction Attribute so every
ejb starts in a new transaction and each method only invoke one database access
We are now considering to change the Transaction Attribute to NotSupported So each database access will do a commit (the database connection is set to autoCommit)
We thought that this approach will be more efficient since no transaction will be created.
I will be happy to hear what you think about this approach, is our assumption is correct?it means that the method must operate outside of an active transaction - in other words there will be no active transaction during its runtime. If there is an active transaction when the method is called, that transaction is "put on hold" until the "notsupported" EJB call finishes.
-
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 -
Can i call Bean managed EJB with transaction attribute Required New
I am calling a BeanManaged EJB which has a transaction attribute
set to Required New from a container managed bean. Does it create a new transaction
other than the Bean managed transaction. Do i really need a required new field
transaction attribute.All i need is user controlled transaction.Do i need to set
the transaction aatibute.
Thanks
Krish.
Hi Krish,
The question does not make much sense.
I would suggest that you set all your tx settings to "Required" unless you
have a specific reason to do otherwise, and in those few instances that you
have a specific reason to do otherwise, then change it in just those places.
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"KRISH" <[email protected]> wrote in message
news:[email protected]..
>
> I am calling a BeanManaged EJB which has a transaction attribute
> set to Required New from a container managed bean. Does it create a new
transaction
> other than the Bean managed transaction. Do i really need a required new
field
> transaction attribute.All i need is user controlled transaction.Do i need
to set
> the transaction aatibute.
>
> Thanks
>
> Krish.
>
-
Error deploying EJB on weblogic: Unable to set the transaction attribute
Hi,
I'm trying to deploy an application in WL10.3.2 and an error occurred during activation of changes.
Here is the error message from the log file:
<Jun 6, 2011 1:28:27 PM MDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'serverEAR-2' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
Truncated. see log file for complete stacktrace
Caused By: weblogic.ejb.container.deployer.DeploymentDescriptorException: Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processCTs(MBeanDeploymentInfoImpl.java:1502)
at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processSpecificMethodCTs(MBeanDeploymentInfoImpl.java:1472)
at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeTransactionAttribute(MBeanDeploymentInfoImpl.java:773)
at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:259)
at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1190)
Truncated. see log file for complete stacktrace
Please help me...Thanks.In your ejb-jar.xml you are referring to a method saveActionGroup(EditableActionGroup) which is not defined in your remote interface.
Maybe you have made some typo in the configuration. Check your transaction section, i.e.,
<container-transaction>
<method>
<ejb-name>ViewBean</ejb-name>
<method-name>saveActionGroup</method-name>
<method-params>
<method-param>package.EditableActionGroup</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>or something similar. See if the defined methods are corresponding to the methods defined in the remote interface. -
Help-Problem in calling JMS inside an EJB having transaction attribute Required New
Hi,
Version wl 5.1 service pack 8
OS - unix
I am using a Container managed bean say Bean1(transaction attribute Required)
which in one of its method is trying to call another EJB say Bean2 which has the
transaction attribute set to "RequiredNew".Inside the method in Bean2 i have my
JMS funtions coded to persist to database.JMS uses Queue connection factory and
is an non transaction JMS session.The JMS server is running in a separate weblogic
server and not in the server where EJB is deployed.I use the url of the JMS server
and get the context of that server and connect my JMS.
The problem that i am facing is
I do the transaction in bean1 and the i make the call to bean2 to do the JMS work
and i can see the JMS doing the insert in the table and everthing works fine.But
after few seconds i can see the exception/message seen on the console of the weblogic
server where my JMS server is running as below
Tue Sep 04 15:57:09 CDT 2001:<I> <TX> Transaction (TxC (30486015, xid = 99963563
2756_5, timeout = 30, txState = Marked Rollback, root = 829817264280676325S10.51
.110.237:[7001,7001,7002,7002,7001,-1]/326) rolled back after 30 sec.
After this happen i dont see any roll back in either bean1 or bean2 or the JMS
insert is rolled back.
I don't know why this exception is thrown and no effects on the rollback and it
works the way i wanted.But the only thing that keeps bothering me is the rollback
and why does this happen.
Thanks
Krish.
The exception your seeing is troubling - if the tran is rolled
back than whatever work is associated should also roll back. I suggest
instrumenting your code to see if the tran rolling back is the same tran
that is being used for the transactional application work that appears to succeed.
Also, try forcing a rollback, you may see that the EJB work truly rolls back
while the JMS work does not.
I'm not really familiar with 5.1, but I know there is a fundamental limitation to one
phase commits, this means that the JDBC connection pool used by JMS as well
as that used by the EJB must be one and the same - I'm not exactly sure how
it works, but I'm pretty sure multiple servers can share the same connection pool.
This post seems unrelated to clustering, if you need further help, I
suggest posting in the ejb or transaction newsgroups.
Krish wrote:
> Hi,
>
> Version wl 5.1 service pack 8
> OS - unix
>
> I am using a Container managed bean say Bean1(transaction attribute Required)
> which in one of its method is trying to call another EJB say Bean2 which has the
> transaction attribute set to "RequiredNew".Inside the method in Bean2 i have my
> JMS funtions coded to persist to database.JMS uses Queue connection factory and
> is an non transaction JMS session.The JMS server is running in a separate weblogic
> server and not in the server where EJB is deployed.I use the url of the JMS server
> and get the context of that server and connect my JMS.
>
> The problem that i am facing is
>
> I do the transaction in bean1 and the i make the call to bean2 to do the JMS work
> and i can see the JMS doing the insert in the table and everthing works fine.But
> after few seconds i can see the exception/message seen on the console of the weblogic
> server where my JMS server is running as below
>
> Tue Sep 04 15:57:09 CDT 2001:<I> <TX> Transaction (TxC (30486015, xid = 99963563
> 2756_5, timeout = 30, txState = Marked Rollback, root = 829817264280676325S10.51
> 110.237:[7001,7001,7002,7002,7001,-1]/326) rolled back after 30 sec.
>
>
> After this happen i dont see any roll back in either bean1 or bean2 or the JMS
> insert is rolled back.
>
> I don't know why this exception is thrown and no effects on the rollback and it
> works the way i wanted.But the only thing that keeps bothering me is the rollback
> and why does this happen.
>
> Thanks
>
> Krish.
-
Setting transaction attributes for EJB Create methods
Dear developers
How do I set transaction attributes at the method level. I am able to set this only at the bean level.
I am trying to use container managed transactions.
Thanks
Naveenif you specify * in the <method-name> element, then it is the bean
otherwise, you can specify a particular method name in the <method-name> element.
Best regards...
Dear developers
How do I set transaction attributes at the method
level. I am able to set this only at the bean level.
I am trying to use container managed transactions.
Thanks
Naveen -
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 -
EJB finder query with ORDER BY clause
Hi,
How to query the data in ordered list using Order By clause in the entity Bean.
Here is the part of My code in which i am interrested.
/* @ejbgen:finder
* signature = "Collection findAllData()"
* ejb-ql = "SELECT OBJECT(z) FROM DataProfileBean AS z"
abstract public class DataProfileBean extends EntityAdapter {
* @ejbgen:cmp-field column = DATA_PREFIX
* @ejbgen:primkey-field
* @ejbgen:local-method transaction-attribute = Required
public abstract Integer getDataPrefix();
public abstract void setDataPrefix(Integer DataPrefix);
Now what modification needs to be done in the ejb-ql query to find the DataPrefix in the sorted list.
Regards,
DilipI don't think the current spec for EJBs support ORDER BY. But Weblogic has an extension that you can use (that is, if you're using it). Here's the info: http://e-docs.bea.com/wls/docs61/ejb/cmp.html#1076421
-
EJB QL query error... why??
Ok, so I'm getting an error in my EJB QL and don't know why... do you see anything strange in this query? I append the whole error from the deploytool's verifier. I've double checked that countryBranch exists as a CMR field in BranchCatalog. Any idea?
Error: [ select object(bc) from BranchCatalog bc, in (bc.countryBranch) cb where cb = ?1 ] has parsing error(s)
Exception occured : [Encountered "in ( bc . countryBranch )" at line 1, column 24.
Was expecting one of:
"AbstractSchemaName" ...
"IN" "(" "IdentificationVar" "." "SingleValuedCmrField" "." ...
"IN" "(" "IdentificationVar" "." "CollectionValuedCmrField" ...
EJB QL statement : 'select object(bc) from BranchCatalog bc, in (bc.countryBranch) cb where cb = ?1'
EJB QL method : public abstract com.actaris.eprocurement.domain.catalog.LocalBranchCatalog com.actaris.eprocurement.domain.catalog.LocalBranchCatalogHome.findByCountryBranch(com.actaris.eprocurement.domain.organization.LocalCountryBranch) throws javax.ejb.FinderException
eProcurement: Some tests failed.This my ejb-jar.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<!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>
<enterprise-beans>
<entity>
<description>Entity Bean ( CMP )</description>
<display-name>Product</display-name>
<ejb-name>Product</ejb-name>
<home>Project.ProductHome</home>
<remote>Project.Product</remote>
<local-home>Project.ProductLocalHome</local-home>
<local>Project.ProductLocal</local>
<ejb-class>Project.ProductBean</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>Product</abstract-schema-name>
<cmp-field>
<field-name>productid</field-name>
</cmp-field>
<cmp-field>
<field-name>productname</field-name>
</cmp-field>
<cmp-field>
<field-name>productactive</field-name>
</cmp-field>
<primkey-field>productid</primkey-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params/>
</query-method>
<ejb-ql>select object(o) from Product o</ejb-ql>
</query>
</entity>
<entity>
<description>Entity Bean ( CMP )</description>
<display-name>Project</display-name>
<ejb-name>Project</ejb-name>
<home>Project.ProjectHome</home>
<remote>Project.Project</remote>
<local-home>Project.ProjectLocalHome</local-home>
<local>Project.ProjectLocal</local>
<ejb-class>Project.ProjectBean</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>Project</abstract-schema-name>
<cmp-field>
<field-name>projectid</field-name>
</cmp-field>
<cmp-field>
<field-name>projectname</field-name>
</cmp-field>
<cmp-field>
<field-name>projectactive</field-name>
</cmp-field>
<primkey-field>projectid</primkey-field>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params/>
</query-method>
<ejb-ql>select object(o) from Project o</ejb-ql>
</query>
<query>
<query-method>
<method-name>findByProjectname</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select object (o) from Project o where o.projectname = ?1</ejb-ql>
</query>
<query>
<query-method>
<method-name>findByProjectproduct</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select object (o) from Project as o, in (o.projectproduct) as p where p.productname = ?1 and o.projectactive = ?2</ejb-ql>
</query>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<ejb-relation-name>Project - Product</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Project may have one Product</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>Project</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>product_projectproduct</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Product may have many Project</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Product</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>project_projectproduct</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
</relationships>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Product</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>Project</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
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
nullI 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. -
EJB 3.0 Core Spec (Transaction and BMT)
On Page 342 Core EJB Specs:
If the client request is associated with a transaction T1, and the instance is not associated with a transaction, the container suspends the client�s transaction association and invokes the method with an unspecified transaction context. The container resumes the client�s transaction association (T1) when the method (together with any associated interceptor methods) completes. This case can never happen for a message-driven bean or for the invocation of a web service endpoint method of a stateless session bean.
Doubt:
Message driven beans can have Transaction attribute specified as Not Supported or Required. In the case of Not Supported - the above can happen?.
Also, why is not applicable for invocation of a web service endpoint method of a stateless session bean and applicable for a stateless session bean call?
Please guide,
ShivaniHi Shivani,
In the JMS programming model, transactions do not propagate from the message
producer to the message consumer so there is not any possibility for a transaction to propagate
into the JMS MDB's onMessage method. However, the text could actually use some qualification
since MDBs are capable of consuming other types of inbound messages through the Connector 1.5
contracts. In those cases it is possible for a transaction to propagate into the MDB.
Regarding WebServices, Java EE 5 does not require support for transaction propagation on
web service invocations. When this text was written such propagation was prohibited. That
restriction was loosened in Java EE 5 so this also needs some rewording.
--ken
Maybe you are looking for
-
How to add Target System to Remote Comparison in Version Management
Hello, We have defined an RFC connection from System A to system B. We want to use system B for remote comparison or programs from system A. However, when we choose (from SE38): Utilities -> Version Management -> REMOTE Comparison -> Target System sy
-
Hi, in oracle express, on a report querry region I give this : select 'PINS - # of times an item in the library cache was executed - '|| sum(pins), 'RELOADS - # of library cache misses on execution steps - '|| sum (reloads), 'RELOADS / PINS * 100 = '
-
Hi, How do I get to build a trial balance in BPC. We have BPC 10.0 Sincerely Nicky
-
I tried to update my ipad 2 to the new 6.1. It is taking ages...it has been already more then 2 hours stating verifying update. My ipad is not jailbroken or whatever else it is called. I never had any issues with previous updates. Is this normal?
-
Opacity and mask define knockout shape. how does it work?
I can`t get the 3rd option now in the transparency dialog box. opacity and mask define knockout shape... I placed a star within a group of 2 green squares with their own opacity and blend modes, and a blue triangle beneath this group, I can`t see any