Transactional persistence-modifier
Hi,
I'd like to define a field of a persistent class as "transactional". This
field is not mapped to a table column, but it must be rolled-back when
transaction aborts.
According to JDO specification, I tryed to use the "persistence-modifier"
attribute of the "field" element in jdo metadata, as follows:
<jdo>
<package name="it.tasso.model">
<class name="Indirizzo" objectid-class="IndirizzoId">
<field name="id" primary-key="true"/>
<field name="transazValue" persistence-modifier="transactional"/>
</class>
</package>
</jdo>
But at runtime, when the persistent object is retrieved from the
datastore, the following error occurs:
Exception in thread "main" kodo.jdbc.meta.MappingInfoNotFoundException: No
mapping information was found for "it.tasso.model.Indirizzo.transazValue".
I't obvious that there's no mapping information, because that field is
just transactional. In fact, kodo documentation says:
persistence-modifier: Specifies how JDO should manage the field. Legal
values are persistent for persistent fields, transactional for fields that
are non-persistent but can be rolled back along with the current
transaction,
If the persistence-modifier attribute is set to NONE, no errors occurs.
Where's my mistake?
Patrick Linskey wrote:
First of all, thank you very much for your help. I'm the guy you met in
Bologna few days ago (the one who speaks really bad english). ;-)
Now it works, but there is a step further.
If a transactional field is modifyed inside a transaction, the state of
the object is dirty.
If a persistent field of a detached object is modifyed, when the object is
attached its state is dirty.
If a transactional field of a detached object is modifyed, when the
object is attached its state is NOT dirty.
This is a sample code;
KodoPersistenceManager kpm =(KodoPersistenceManager)pm;
kpm.currentTransaction().begin();
Extent ext = pm.getExtent(Indirizzo.class,true);
Iterator it = ext.iterator();
Indirizzo ind =null,attachedInd,detachInd;
if(it.hasNext()){
ind = (Indirizzo)it.next();
//this is a transactional field
ind.setTransazValue("Pippo");
if(JDOHelper.isDirty(ind)){
System.out.println("STEP 1: DIRTY");
detachInd = (Indirizzo)kpm.detach(ind);
pm.currentTransaction().commit();
//this is a transactional field
detachInd.setTransazValue("Pluto");
pm.currentTransaction().begin();
attachedInd = (Indirizzo)kpm.attach(detachInd);
if(JDOHelper.isDirty(attachedInd)){
System.out.println("STEP 2: DIRTY");
} else {
System.out.println("STEP 2: CLEAN");
detachInd = (Indirizzo)kpm.detach(attachedInd);
kpm.currentTransaction().commit();
// this is a persistent field
detachInd.setDes("foo");
kpm.currentTransaction().begin();
attachedInd = (Indirizzo)kpm.attach(detachInd);
if(JDOHelper.isDirty(attachedInd)){
System.out.println("STEP 3: DIRTY");
} else {
System.out.println("STEP 3: CLEAN");
kpm.currentTransaction().commit();
This is the result of the code above:
STEP 1: DIRTY
STEP 2: CLEAN
STEP 3: DIRTY
This means that Kodo in able to detect changes for a persistent field of a
detached object, but NOT for a transactional field. Is it right?
What happens if you explicitly mark that the field is not mapped? You
can do this by putting the following in your mapping file:
<field name="transazValue">
<jdbc-field-map type="none"/>
</field>
-Patrick
Claudio Tasso wrote:
Hi,
I'd like to define a field of a persistent class as "transactional". This
field is not mapped to a table column, but it must be rolled-back when
transaction aborts.
According to JDO specification, I tryed to use the "persistence-modifier"
attribute of the "field" element in jdo metadata, as follows:
<jdo>
<package name="it.tasso.model">
<class name="Indirizzo" objectid-class="IndirizzoId">
<field name="id" primary-key="true"/>
<field name="transazValue" persistence-modifier="transactional"/>
</class>
</package>
</jdo>
But at runtime, when the persistent object is retrieved from the
datastore, the following error occurs:
Exception in thread "main" kodo.jdbc.meta.MappingInfoNotFoundException: No
mapping information was found for "it.tasso.model.Indirizzo.transazValue".
I't obvious that there's no mapping information, because that field is
just transactional. In fact, kodo documentation says:
persistence-modifier: Specifies how JDO should manage the field. Legal
values are persistent for persistent fields, transactional for fields that
are non-persistent but can be rolled back along with the current
transaction,
If the persistence-modifier attribute is set to NONE, no errors occurs.
Where's my mistake?
Similar Messages
-
Transactions, Persistence Contexts and Entity Managers... Oh My!
Hi
I am just getting into J2EE and EJB3. I have no prior experience with EJB2, we avoided it with our own POJO data access framework. With the advent of EJB3 we would like to use it in a new application.
I am reading the book "Pro EJB 3" by Ketih and Schincariol and am having trouble wrapping my head around then Entity Manager chapter. I don't think it's any fault of the authors, but somehow it's just not coming together in my head. Perhaps it's because I have no real prior EJB experience.
Can anyone point me to a resource that gives an overview of the relationships between Transactions, Persistence Contexts and Entity Managers? Or perhaps I just have to keep mulling it over until it all comes together...?
Thanks in advance!Hi Shelli,
I haven't read that book but I don't know of a good writeup of the tx topic specifically outside
of the spec itself. There are certainly a lot of combinations, between container-managed
vs. bean-managed EntityManagers, and JTA vs. resource-local. However, the
common usage case within Java EE -- container-managed and JTA -- is very simple.
In this case, the container automatically associates the persistence context with the
active global transaction. If you make a call to another Java EE component within the
same transaction and that component accesses a container-managed EntityManager
for the same persistence unit, the persistence context is automatically propagated so
that both components "see" the same persistence context.
--ken -
Hi,
What is the transaction to modify a table (oracle) ?
Thanks in advanceDear Jean,
Sometime,Changes to the Table data without analyzing its data dependency may lead to Data Inconsistency. So, be careful.
Changes to the production system always require comprehensible documentation.
If you are changing your Table Data using SE16N, the accompanying changes are logged as well as the responsible users are logged. The data changes are stored in the table SE16N_CD_DATA. And The responsible user is listed in the table SE16N_CD_KEY, together with the modification date and time.
Regards,
Bhavik G. Shroff -
OBXR- Special GL Transaction Types - Modify Fields
Hello Gurus. We are on ECC 6.0 with New GL. Is there a way to modify which fields are available for the Special GL Transaction types in OBXR ? For example: In OBXR go to Properties. We selected Down Payment/Down payment request, later on when we enter a document via FB01 or FB50 or when we post a payment via F-28, and we select Posting Key 09 or 19 and use the Special GL Indicator we are able to display and enter information in BSEG-PRCTR (Profit Center field).
If on the other hand in OBXR we set up another Special GL Transaction type and we select Others, then BSEG-PRCTR (profit center field) is not even available, but we are able to enter BSEG-ZFBDT and later on modify this same field (BSEG-ZFBDT) via FB02.
I would greatly appreciate your guidance in how to modify/include additional fields in these Special GL Transaction types. Thanks!Hi Enrique,
Are you referring to the document screen layout when you enter the document in the special GL transactions?
This is controlled by the field status of the posting key in question. Using transaction code OB41you can double click on the posting key (say 09) and inside you find something called as maintain field status. Clicking on the same, you will be able to see various groups under which you can make the necessary settings like optional/reqd/suppressed.
Thanks
Aravind -
Greyed out screen field in transaction but modifiable by batch input
Hi Gurus,
I have a requirement where a custom screen field in a transaction (FK01/FK02/XK01/XK02) has to be greyed out when a user access these transactions. However, these fields will have to be modifiable when LSMW/batch input is being done.
I hope someone can advise how I can do this.
I'll definitely reward points for helpful answers.
Thanks so much.
Rgds,
JoyieDeclare on your layout input is 0. Or the field cannot be filled by value.
After you have done that, create some code like this:
Loop at screen.
IF sy-batch is not initial or sy-binpt is not initial.
if screen-group1 = 'ANL'
screen-input = '1'.
endif.
endif.
endloop.
Hope it helps solve your problem. -
Locking transaction from modifying table
Hi All,
We have a transaction. This transaction is used to modify the data in certain tables. Currently multiple users can open the transaction in 'Change Mode'. We have to put a lock if one 'Change Mode' is open for transaction, it should say other new users that they can't modify it and open in display mode.
We thought of following strategy:
1. Create lock object for each corresponding to each table.
2. Call Enqueue Function Modules in PBO of different screens used in transaction.
Now problem is that once user is leaving the transaction he/she should dequeue it. We can do it by calling Dequeue FMs corresponding to 'BACK/EXIT/CANCEL' buttons. But can't think how to handle the scenario if user presses '/n'.
You can also suggest any other way of handling the issue as well.
Regards,
AshwiniHi,
The locks releases are dependent on the scope parmeter which you are passing ot the ENQUEUE_FUNCTION module.
There are this parameter can have 3 values 1,2,3.
We need to pass correct value depending on your requirement.
If you are updating all the tables in the same program which you are using to displaying the transaction go for scope parameter 1. So the lock will get released automatically when you end the transaction.
If you use some function module at update task then use the scope parameter 2. In such case you need to end it after updation using DEQUQE_<lock object> FM.
Generally locks will get released once the transaction got ended by /n. You can check that in T code SM12. after coming out of transaction. No need of Dequeue FM in such case.
Thanks
Kiran.
Edited by: kiran Pasala on Jun 26, 2009 3:36 PM
Edited by: kiran Pasala on Jun 26, 2009 3:38 PM -
How to transaction in the message driven bean?
hello
i write a message driven bean,that monitor the weblogic message queue,when a "Order"
object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all
of above logic is within the "onMessage" method of the mdb.
i want to encapsulate the flow in a transaction,see my code snippet of the onMessage
method:
ObjectMessage objMsg = (ObjectMessage) msg;
OrderVO orderVO = (OrderVO) objMsg.getObject();
System.out.println(orderVO.booklist);
OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
"java:/comp/env/orderinfo");
Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
orderinfo.setAddress(orderVO.address);
orderinfo.setCustname(orderVO.custName);
orderinfo.setEmail(orderVO.email);
orderinfo.setBooklist(orderVO.booklist);
orderinfo.setPrice(new BigDecimal(orderVO.price));
and deploy descriptor snippet(ejb-jar.xml):
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>orderMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
i think during this transaction,there are two action:geting the object from the
queue and saving it to entity bean.in order to test the transaction,i modify the
jndi name of entity bean in the code to a WRONG one.redeploy my program,and send
a message to the queue,the mdb is activated,then the exception is thrown because
of the wrong jndi name.after that,i check the message queue,find that it is empty.why?i
think if the second action of the transaction is fail,the transaction should roll
back,the message should be send BACK to the queue.
i also ty to use the "javax.transaction.UserTransaction" in the onMessage method,but
the follwing exception is thrown:
javax.transaction.NotSupportedException: Another transaction is associated with
this thread.................................
who can help me,if any wrong with me,and how to use the transaction with the message
driven bean?
thank you.
The transaction should rollback if the MDB throws an
exception. Try changing your MDB code to
call "setRollbackOnly()" on the EJB
context (instead of throwing an exception) to see
if that works. If calling "setRollbackOnly()" fixes
the problem - then please contact customer support
and report a bug.
zbcong wrote:
> hello
>
> i write a message driven bean,that monitor the weblogic message queue,when a "Order"
> object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all
> of above logic is within the "onMessage" method of the mdb.
> i want to encapsulate the flow in a transaction,see my code snippet of the onMessage
> method:
>
>
> ObjectMessage objMsg = (ObjectMessage) msg;
> OrderVO orderVO = (OrderVO) objMsg.getObject();
> System.out.println(orderVO.booklist);
> OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
> "java:/comp/env/orderinfo");
> Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
> orderinfo.setAddress(orderVO.address);
> orderinfo.setCustname(orderVO.custName);
> orderinfo.setEmail(orderVO.email);
> orderinfo.setBooklist(orderVO.booklist);
> orderinfo.setPrice(new BigDecimal(orderVO.price));
>
>
> and deploy descriptor snippet(ejb-jar.xml):
>
>
> <assembly-descriptor>
> ............
> ...........
>
> <container-transaction>
> <method>
> <ejb-name>orderMDB</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>Required</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
>
>
> i think during this transaction,there are two action:geting the object from the
> queue and saving it to entity bean.in order to test the transaction,i modify the
> jndi name of entity bean in the code to a WRONG one.redeploy my program,and send
> a message to the queue,the mdb is activated,then the exception is thrown because
> of the wrong jndi name.after that,i check the message queue,find that it is empty.why?i
> think if the second action of the transaction is fail,the transaction should roll
> back,the message should be send BACK to the queue.
>
> i also ty to use the "javax.transaction.UserTransaction" in the onMessage method,but
> the follwing exception is thrown:
>
> javax.transaction.NotSupportedException: Another transaction is associated with
> this thread.................................
>
> who can help me,if any wrong with me,and how to use the transaction with the message
> driven bean?
>
> thank you.
>
>
-
Forte Transaction Management & 2PC
Forte Transaction Management & 2PC
The main purpose of 2PC in a distributed transaction manager is
to enable recovery from a failure that occurs during the window
of transaction commit processing. The Forte transaction manager was built
with this in mind but only with respect to the "volatile" (or "in memory")
objects that Forte manages. What this implies is that because Forte stores
objects in memory and not persistently on disk, the requirement of recovery
for these objects is significantly reduced (if not eliminated all together).
Forte follows a distributed 2PC model in that tasks and messages carry
along with them transaction identification and, during commit processing,
every distributed participant is polled for its availability to commit
the transaction. Applications saving persistent data to disk during a
distributed Forte transaction need to concern themselves with the potential
for failure during the commit processing window. Forte's prepare phase polls
each site (confirming a communications link with each distributed participant)
but no prepare request goes to the database primarily because (in release 1 and
2 of forte) no database supported a general distributed two-phase commit
(one could take issue with that in the case of Sybase, but rather than debate
this point, suffice it to say that the general direction in the industry for
support of this functionality was through TP monitors -- more on that later).
Once all sites are ready to commit Forte expects that the commit will
complete successfully. If at this moment, for example, a participating
Sybase server terminates (with data not yet committed) while a participating
Oracle server has already committed its unit of work, then the outcome of
the distributed transaction is inconsistent - if no one has yet committed
Forte will still abort the transaction. This "window of inconsistency"
is documented in the Forte TOOL manual.
Mission critical applications that require distributed transactions can
address this window of inconsistency in a number of ways:
* Utilize a TP monitor such as Encina (see below)
* Log distributed updates in an auxiliary database table (much like a
distributed transaction monitor's transaction-state log). This approach has
been the traditional banking application solution prior to the commercial
availability of products like Encina, Tuxedo, TopEnd, etc.
This solution is somewhat complex and is usually not generic enough
so as not to have to change code every time a new table or database
site is introduced into the application's data model.
* Rearrange the data model in order to eliminate the need for distributed
transactions. This is usually only a temporary solution (with smaller
numbers of active clients) and cannot be applied to complex legacy systems.
With the advent of the X/Open distributed transaction architecture (the
XA Interface) more database vendors have found that by complying with the
XA interface they can plug their database-specific implementation of
transaction into a globally managed transaction, with commit and abort
processing being conducted by a central coordinator. Of course, the
overall transaction manager coordinating the global transaction must
itself, persistently record the state of the different distributed
branches participating in the transaction. A significant portion of
the functionality provided by products such as Encina, Tuxedo, TopEnd and
OpenTP1 is to provide exactly this global transaction management.
Rather than extend the Forte distributed transaction manager with the
functionality necessary to manage and recover distributed transactions
that modify data on disk, Forte has chosen to integrate with the emerging
set of commercial transaction monitors and managers. This decision was
built into the original design of the Forte transaction model (using XA and
early Tuxedo white-papers as guidelines):
* In Forte release 2 an integration with Encina was delivered.
* In January 1997 a press release announced an integration of
OpenTP1 with Forte for release 3.
* The Forte engineering staff is currently investing integration
with other transaction management products as well.
Neil Goodman,
Forte Development.You don't. ("manage" a transaction)
There is nothing really to "manage".
A transaction is automatically started when you make any changes to data (e.g. fire off a DML statement).
You simply needs to issue a COMMIT or ROLLBACK when needed. A COMMIT at the end of the business transaction and not before (i.e. no committing every n number of rows). A ROLLBACK when hitting an exception or business logic error that requires the uncommitted changes to be undone.
That in a nutshell is it. It is that simple.
Oracle also supports creating savepoints and rolling back only some changes made thus far in the transaction.
The only other thing to keep in mind that a DDL in Oracle issues an implicit commit. Firing off a DDL with cause any exiting uncommitted transaction to be committed.
Transaction "logic/management" should not be made more complex than this. -
IW31 - User Exit or BADI for modifying Fund
Hi,
Would you know any user exit or BADI in IW31 I Work Order Create) Transaction , to Modify Fund based during creation ?
I am looking for User Exit or BADI that could modift fund with my Logic, During SAVE "or" when ever user clicks on Menu GOTO-> Assignments -> Funds Management "or" when use enetrs Functional Location/ Equipment in main Screen ?
Any Help really appricated. Thanks in Advance.hi
this is the only exit for iw31..
Transaction Code - IW31 Create Order
Exit Name Description
IWO10012 Maintenance order: Priority handling on central header
To search for a badi, go to se 24 display <b>class cl_exithandler.</b>
double click on method get_instance, get a break point on case statement.
execute and start the required transaction in new session.
look for variable <b>exit_name.</b> It would show the available badi's.
Please do reward if useful
Regards
Swati -
Oracle's serializable transactions cannot be serialized
I'm new to oracle. Here is my understanding of oracle's serializable transactions. Feel free to correct me if i'm wrong.
In my option, the serializable transactions that oracle supports cannot always be serialized.
Oracle suports serializable transactions by ensuring a serializable transaction cannot modify rows changed by other transactions after the serializable transaction began. (Oracle7 Server Concepts Manual, Data Concurrency).
However this constraint doesn't ensure two transactions can be serialized. For example, consider a table A that has two columns: rowid and num.
A has two rows:
rowid num
1 1
2 2
There are two oracle serializable transactions (T1 and T2) defined as follows.
T1
read row 1 from table A into r1
if (r1.num == 1) {
update num of row 2 to 100
commit;
T2
read row 2 from A into r2
if (r2.num == 2) {
update num of row 1 to 100
commit;
Note: row i refers to the row in the table A that has rowid equal to i, for i=1, 2
Consider the following senario:
T1: read (1, 1)
T1: write (2, 100)
T2: read (2, 2)
T2: write(1, 100)
T1: commit
T2: commit
In oracle, the senario above will get executed without any error.
After T1 and T2 commit, the table A has the following rows:
rowid value
1 100
2 100
However, if you serialize T1 and T2, the table A can only be either
rowid value
1 1
2 100
if T1 runs before T2;
or
rowid value
1 100
2 2
if T2 runs before T1.
The conclusion is that serializable transactions in Oracle cannot always be serialized.
Anything wrong in my example?
Thanks
nullNote on the line
46 if (result == null)
47 {
48 String MontoDocumento1 = (String) vo.getCurrentRow (). GetAttribute ("MontoDocumento");
49 String redondeado1 = Round (MontoDocumento1);
50 if (redondeado1.equals ("Y"))
51 { ........
I call a number then convert to string:
String MontoDocumento1 = (String) vo.getCurrentRow (). GetAttribute("MontoDocumento");
and then pass it to double:
Double.valueOf double v_number = (number). doubleValue ();
in my function:
Rounding public String (String number)
Return String;
Double.valueOf double v_number = (number). doubleValue ();
if (v_number == (Math.rint (v_number * 100) / 100))
return = "Y";
else
return = "N";
return return;
Which brings me back a string with the value Y or N.
Thanks if you could help me
Edited by: 917616 on 29/02/2012 07:16 AM -
Disable parts of menubar of standard transaction IW53
Hi,
i want to use transaction iw53 via ITS.
For this i created a service in sicf and maintained the konfiguration for gui as followed:
~TRANSACTION value IW53
~THEME value SL
~GENERATEDYNPRO value 1
~ITSMOBILE value 1
~_DOMAINRELAXED value 1
This works fine, BUT
when i go to the notification i want to disable the part "Service notification" of the menu bar to avoid the changing of the notification.
Is it possible to disable this part?
maybe via HTML-Template? Generate a template for transaction and modify this template?
If its possible how can i change the template for this case?
i have not any experience in using and binding HTML-Templates.
Thanks a lot
best regards
Dennis
Edited by: Dennis Goerke on May 20, 2010 12:19 PMHi Dennis,
You have to use ~webgui_simple_toolbar parameter on your ITS service to do this.
Look this wiki:
http://wiki.sdn.sap.com/wiki/display/HOME/Article-EmploySAPGUIforHTMLinsteadofanInternet+service
Hope this helps,
Ivá -
List of transactions and there modification date
Hi everyone,
I wish to get a list of all the transactions that exist in a specific environment along with the date that the transaction was modified or edited (I'm referring to the source code of the transaction)
Is there a table that holds that data?
Thanks,
RoyHi Roy,
a transaction does not have source code. See F1 on differenmt types of transactions.
Probably you mean transactions staring a report and/or calling a screen of a module pool/function group.
You can see the relation in table TSTC. No time stamp her - you can only check it from transports.
The programs in column PGMNA must be checked with all their screens, includes, GIU status and what else you see in SE80.
You must find out the load generation time because a change in included data dictionary structures may change many things.
And if any customizing involved has changed, then...
I don't know what kind of surveillance you have in mind. Better have more control on transports and never allow anything done in productive system without transport.
Regards,
Clemens -
hello
i write a message driven bean,that monitor the weblogic message queue,when a "Order"
object is witten to the queue,the mdb get it and write it to a entity bean "Orderinfo".all
of above logic is within the "onMessage" method of the mdb.
i want to encapsulate the flow in a transaction,see my code snippet of the onMessage
method:
ObjectMessage objMsg = (ObjectMessage) msg;
OrderVO orderVO = (OrderVO) objMsg.getObject();
System.out.println(orderVO.booklist);
OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
"java:/comp/env/orderinfo");
Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
orderinfo.setAddress(orderVO.address);
orderinfo.setCustname(orderVO.custName);
orderinfo.setEmail(orderVO.email);
orderinfo.setBooklist(orderVO.booklist);
orderinfo.setPrice(new BigDecimal(orderVO.price));
and deploy descriptor snippet(ejb-jar.xml):
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>orderMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
i think during this transaction,there are two action:geting the object from the
queue and saving it to entity bean.in order to test the transaction,i modify the
jndi name of entity bean in the code to a WRONG one.redeploy my program,and send
a message to the queue,the mdb is activated,then the exception is thrown because
of the wrong jndi name.after that,i check the message queue,find that it is empty.why?i
think if the second action of the transaction is fail,the transaction should roll
back,the message should be send BACK to the queue.
i also ty to use the "javax.transaction.UserTransaction" in the onMessage method,but
the follwing exception is thrown:
javax.transaction.NotSupportedException: Another transaction is associated with
this thread.................................
who can help me,if any wrong with me,and how to use the transaction with the message
driven bean?
thank you.Hi,
A failure to lookup a jndi name will throw NamingException and this will not rollback
the tx. To rollback the tx, you need to explicity set the tx context status to
rollbackonly or throw a system exception ( which will discard that MDB instance).
Application exceptions do not rollback the tx.
In your scenario, the tx started on invoking onMessage routine and infects the
Entity beans business method. You can either throw a system exception in either
the onMessage routine or the entity beans business method or explicity set the
tx status to rollbackonly to rollback the tx.
ram
"zhebincong" <[email protected]> wrote:
>
hello
i write a message driven bean,that monitor the weblogic message queue,when
a "Order"
object is witten to the queue,the mdb get it and write it to a entity
bean "Orderinfo".all
of above logic is within the "onMessage" method of the mdb.
i want to encapsulate the flow in a transaction,see my code snippet of
the onMessage
method:
ObjectMessage objMsg = (ObjectMessage) msg;
OrderVO orderVO = (OrderVO) objMsg.getObject();
System.out.println(orderVO.booklist);
OrderinfoHome orderinfoHome = (OrderinfoHome) ctx.lookup(
"java:/comp/env/orderinfo");
Orderinfo orderinfo = orderinfoHome.create(orderVO.orderID);
orderinfo.setAddress(orderVO.address);
orderinfo.setCustname(orderVO.custName);
orderinfo.setEmail(orderVO.email);
orderinfo.setBooklist(orderVO.booklist);
orderinfo.setPrice(new BigDecimal(orderVO.price));
and deploy descriptor snippet(ejb-jar.xml):
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>orderMDB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
i think during this transaction,there are two action:geting the object
from the
queue and saving it to entity bean.in order to test the transaction,i
modify the
jndi name of entity bean in the code to a WRONG one.redeploy my program,and
send
a message to the queue,the mdb is activated,then the exception is thrown
because
of the wrong jndi name.after that,i check the message queue,find that
it is empty.why?i
think if the second action of the transaction is fail,the transaction
should roll
back,the message should be send BACK to the queue.
i also ty to use the "javax.transaction.UserTransaction" in the onMessage
method,but
the follwing exception is thrown:
javax.transaction.NotSupportedException: Another transaction is associated
with
this thread.................................
who can help me,if any wrong with me,and how to use the transaction with
the message
driven bean?
thank you. -
RBDMIDOC doesn't execute when exit from transaction is not performed
Hello Experts,
I have configured the RBDMIDOC report in a job schedule for the IDoc HRMD_A.
The schedule executes daily in the evening after business hours.
Sometimes it happens that the HR person does not / forgets to exit from the PA30, PA40 transaction after modifying the records.
In such situations the job does not execute at all.
Is there any remedy for the above?
Regards,
Alka.Hi,
I think you cannot apply any check on this , Idoc creation will stop if t-code are locked means used by some other user for updation.
thanks
manish -
FEBA posting- issue with transaction reference field
Hello Friends ,
we have an issue while performing FEBAposting , One fo the user exist is using thefield - VWEZW(Note to Payee ) from the table FEBRE . This has a data issue as a result of which we are getting a DUMP .
I suppose there is a standard transaction to modify the entries.
please advice if you are aware.
thanks
Raghu VHi Ryan,
Please check if you are getting any error like below in the logs.
"statement is closed at the index 501 Transaction ID"
If yes, then this issue was fixed in SP08. Please check the SAP note: 1168183.
Regards,
Shweta,
Maybe you are looking for
-
[CS5] Overriding elements from master of master
I have two masters, A-product and B-product 1. Master B-product 1 is based on A-product. 'myPage" based on B-product 1. Overriding elements from B-product 1 to document page works, but I can't override elements from A-product master. I can found elem
-
Hi I just bought the FX5200(has DVI) and a dvi LCD monitor(philips 170B4). how do I use the dvi interface? When i juz plug in the cables to the DVI sub, there is "no VIDEO INPUT" What should I do. Well the VGA interface worked for sure. Do I need a d
-
Drag and drop no longer possible in excell 2007 on vista
Hi, we just migrated to Vista with office 2007. So we are now on GUI 7.10 Patch 4; BI add-on's SP2 Patch 1. Is it normal that we no longer can drag and drop (add characteristic; swap columns;...) or is there something wrong? Ciao! Joke
-
Aperture 3.4.1 automatically switches to the next or previous image
For the past few weeks Aperture has been doing something really odd and extremely annoying. While I'm editing an image, aperture will suddenly move to the next image. It happens primarily when I'm using the stamp tool and am stamping adjustments onto
-
Disable Email delivery option in Crystal reports 2013
Hello, Is there any way in which i can restrict the users from delivering the scheduled crystal reports on the Email address. Any settings available in CMC /Services ? I want that they should only be able to schedule crystal reports and receive intan