How does TopLink determine external transaction controller is active?
Weblogic 9.2. I am having a problem with a new EJB: getExternalTransactionController() is null, getActiveUnitOfWork() is null, and yet when my code issues a commit, TopLink throws 4002 [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Cannot call commit when using distributed transactionsError Code: 0. Our code uses getActiveUnitOfWork() to decide whether to issue the commit or not. I had to turn off external transactions for the time being by changing the attribute in ejb-jar.xml to supports.
This is one of those crazy making problems where the session is (except for the deployment.xml) identical to one for an EJB that is not having any external transaction problems. They are deployed in the same ear and the ejb-jar.xml configuration was the same before I changed the failing EJB to supports.
What attribute causes TopLink to throw the 4002?
Thanks
If you configure TopLink to use an external transaction controller then you should use container managed transactions where the the declared transactions on session/message-driven beans control the transaction begin/commit or use the container's UserTransaction to control the transaction life cycle. TopLink's beginTransaction and commitTransaction should not be used as you have decided that the container controls the transactions externally of TopLink's control.
When using TopLink with an external transaction controller the getActiveUnitOfWork looks up the active transaction in the container and returns a UnitOfWork unique per container transaction. If no transaction is active then null is returned.
Note: the UnitOfWork.commit() only has an effect when not using an external transaction controller. If you are using an external transaction controller then UnitOfWork.commit() will only flag the UnitOfWork as complete but will not atually write any changes.
I am not sure I am answering you question but hope this helps.
Doug
Similar Messages
-
Need advise for best practice when using Toplink with external transaction
Hello;
Our project is trying to switch from Toplink control transaction to using External transaction so we can make database operation and JMS operation within a single transaction.
Some of our team try out the Toplink support for external transaction and come up with the following initial recommendation.
Since we are not familar with using external transaction, I would like member of this forum and experts, to help comment on whether these recommendation are indeed valid or in line with the best practice. And for folks that have done this in their project, what did you do ?
Any help will be most appreciated.
Data Access Objects must be enhanced to support reading from a TOPLink unit of work when using an external transaction controller. Developers must consider what impact a global transaction will have on the methods in their data access objects (DAOs).
The following findSomeObject method is representative of a finder in the current implementation of our DAOs. It is not especially designed to execute in the context of a global transaction, nor read from a unit of work.
public findSomeObject(ILoginUser aUser, Expression queryExpression)
ClientSession clientSession = getClientSession(aUser);
SomeObject obj = null;
try
ReadObjectQuery readObjectQuery = new ReadObjectQuery(SomeObject.class);
readObjectQuery.setSelectionCriteria(queryExpression);
obj = (SomeObject)clientSession.executeQuery(readObjectQuery);
catch (DatabaseException dbe)
// throw an appropriate exception
finally
clientSession.release();
if (obj == null)
// throw an appropriate exception
return obj;
However, after making the following changes (in blue) the findSomeObject method will now read from a unit of work while executing in the context of a global transaction.
public findSomeObject(ILoginUser aUser, Expression queryExpression)
Session session = getClientSession(aUser);
SomeObject obj = null;
try
ReadObjectQuery readObjectQuery = new ReadObjectQuery(SomeObject.class);
readObjectQuery.setSelectionCriteria(queryExpression);
if (TransactionController.getInstance().useExternalTransactionControl())
session = session.getActiveUnitOfWork();
readObjectQuery.conformResultsInUnitOfWork(); }
obj = (SomeObject)session.executeQuery(readObjectQuery);
catch (DatabaseException dbe)
// throw an appropriate exception
finally
if (TransactionController.getInstance().notUseExternalTransactionControl())
session.release();
if (obj == null)
// throw an appropriate exception
return obj;
When getting the TOPLink client session and reading from the unit of work in the context of a global transaction, new objects need to be cached.
public getUnitOfWork(ILoginUser aUser)
throws DataAccessException
ClientSession clientSession = getClientSession(aUser);
UnitOfWork uow = null;
if (TransactionController.getInstance().useExternalTransactionControl())
uow = clientSession.getActiveUnitOfWork();
uow.setShouldNewObjectsBeCached(true); }
else
uow = clientSession.acquireUnitOfWork();
return uow;
}As it generally is with this sort of question there is no exact answer.
The only required update when working with an External Transaction is that getActiveUnitOfWork() is called instead of acquireUnitOfWork() other than that the semantics of the calls and when you use a UnitOfWork is still dependant on the requirements of your application. For instance I noticed that originally the findSomeObject method did not perform a transactional read (no UnitOfWork). Has the requirements for this method changed? If they have not then there is still no need to perform a transactional read, and the method would not need to change.
As for the requirement that new object be cached this is only required if you are not conforming the transactional queries and adds a slight performance boost for find by primary key queries. In order to use this however, objects must be assigned primary keys by the application before they are registered in the UnitOfWork.
--Gordon -
This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!
Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
From the Transform panel you can set a text box's width and height -
How does vendor determine if no info record is maintained for the material
how does vendor determine if no info record is maintained for the material
Hi
If you have to determine a vendor, the minimum requirement is Info record. Beyond that, you can ofcourse maintain Source Lists, Quota Arrangements but Info record is bare minimum for automatic determination of vendor.
Otherwise, you have to maintain the vendor manually in th Purchasing docs.
Tcodes for Info record are ME11, ME12, and ME13.
Hope this clarifies.
Thanks -
How does SharePoint determine files are duplicates in search results?
In the search results, some files are grouped as duplicates (a hyperlink view duplicates appears under the search result).
How does SharePoint determines that 2 files are duplicates?
How does SharePoint determines the one that is shown in the search result (the 'main' file)?
Can we influence both?
Patrik | My BlogI don't know if this helps, but I've been looking into the same problem that's come to light a few times during troubleshooting customised deployments of SharePoint recently. This is my understanding so far (paraphrased from http://blogs.technet.com/harikumh/archive/2008/11/14/some-interesting-facts-about-sharepoint-2007-search.aspx):
Document similarity or matching for the purposes of identifying duplicates is based only on a hash of the content of the document. None of the file properties are used in calculating the hash (i.e. things like filename, author, create and modify dates are not used). The SQL table MSSDuplicateHashes in the SSP’s search database holds all the 64bit hashes necessary to determine if one document is a near-duplicate of another against each indexed document. This table is read while doing a search to determine duplicates if removal of duplicates is enabled.
Steve -
How does impdp handles external tables
I am just done with schema import and one of the package is invalid because it is referring the External Table. I am getting the error " Table or View does not exist".
How does impdp handles external tables ?
Do we need to replicate the directories and files from the source to imported destination ?
ThanksHi,
Yes...
external table directory not available on imported destination operating system
You need to create the directories and files from the source to imported destination
Recompile the invalid package
Thanks -
How does EWA determines...?
Hello my friends!
I would appreciate your help with the following question.
How does the EWA report determines the following values, that means what does it check from the monitored system to get
values for the following:
- Avg. Availability per week
- Avg. DB request time in dialog task
- Avg. DB request time in updated task
Thanks in advance and best regards.Hi,
- Avg. Availability per week
I'm not sure, but I think this is from the availability file stored in work directory of the instance. It is not using CCMSPING or other CCMS functions, this is why availability in EWA is often not correct (e.g. if you have a network failure). Also not sure, but I think the KPI Report within solman uses CCMSPING for availability.
- Avg. DB request time in dialog task
From workload stats - same value as in transaction st03n
- Avg. DB request time in updated task
From workload stats - same value as in transaction st03n
Regards,
Frank -
How does systemn determin pricing procedure of billing type
How does system determinate pricing procedure of F2???????????????????
By doc.pric.proc? but in IMG, it is empty!!!
and I don't think it is reference sales order's pricing procedure
because if you use OR + TAN, the reference document of billing is delivery order!!!!!!Hi zhang
In pricing procedure determination OVKK , whatever DuPP you maintain that is linked to Billing document
In VOV8 we can see the CuPP of the document . so if the DuPP is linked to CuPP in OVKK then the same pricing procedure will be flowing to billing document also . Apart from that in VOV8 also make sure that , in billing data you are maintaining the billing type
Regards
Srinath -
What exactly are Upcoming Songs & how does iTunes determine them?
I've never really bothered with Party Shuffle before but it always bugged me when it gave the message about Upcoming Songs. I mean, what is an upcoming song? How does iTunes decide it's upcoming?
Regards,
spriterUpcoming Songs are tracks in Party Shuffle that have not yet been played. You can set how many upcoming songs are visible, but this setting does not determine how many upcoming songs there are.
Party Shuffle is like selecting Shuffle for the Library or any playlist except that you can alter the results. You can add or delete tracks and you can manually reorder the upcoming tracks in Party Shuffle. You can also tell Party Shuffle to play higher rated songs more often.
Regular shuffle stops once every track in the playlist has been played, but Party Shuffle will continue playing, adding repeat tracks when needed. -
How does TimeMachine determine which backup to link to?
We have 4 Macs, each having a Time Machine backup file on an external Time Capsule.
How does the Time Machine on each Mac know which file on that Time Capsule it links to?
Is it done via the file name, meta-data in the backup file, some other method?
Ideas?
Thanks
-MikeBefore "you" start an instance you set env variable ORACLE_SID. This identifies an instance. When you go into sqlplus and issue STARTUP, Oracle starts the instance named by the sid. Thus the instance running on the server is controlled by you. This changes as noted below.
If you were using a non-Oracle tool to start instances, such as Veritas, then you would see it start the instance you coded into the tool. It would not randomly pick an instance. It looks in the Veritas config file and sees that you always want instance 1 on this node and instance 2 on that node.
That said, you can make Oracle more random or "grid" like. 10g RAC done Oracle's way likes to bounce around between primary and secondary nodes. To see which instances are running on a node you can "ps -ef | grep pmon". Alternatively, use sqlplus to look in the database: view gv$instance gives you each instance name paired with the name of the host it is currently running on. There is one line of output per instance currently running.
-Mark -
How does account determination take place ??
dear experts
pls enlighten me on how excatly account determination take place .
what is an account grping code
what is transaction event key
what is the technical name for keys used in OBYC like BSX , WRX GBB etc
what is the other keys like VAX ,INV used within GBB called
what are WE,WR etc
How are movement types linked to valuation
Is it possible to create/change all of the above ??
Regards
AnisHi
Check in OMJJ -Mvt type - update control - with your parameters (purchase order/production order, stock type (Q or E etc)..Otherwise you can use OMWN directly.
1. Initial entry (561)
For this entry BSX and GBB-INV
2.GR against PO(101)
BSX and GR/IR ( -)
3.issue to Cost Center (201)
GBB-VBR and WRX
4.Issue against Prod Order(261)
BSX and GBB-VBR
5.Sale (601)
BSX and GBB-VAX(-)
7.Subcontracting ( material sent as component & consumed against 543)
BSX(+) and GBB-VBO(-)
8.Sucontracting ( material procured )
9. Invoice Verification done where applicable.
This is similar to material revaluation (if you are performing revaluation in MIRO)
then BSX(+) Vendor
otherwise WRX and Vendor (-).
These are the standard postings keeping aside other differences like PRD, PRA etc. You can check mvt types for postings.
If you want to know how valuation groping code, transaction key, account cat.reference alters the account determination then use OMWB Tcode and enter material, plant, choose movement type and click simulation.
Thanks
Edited by: Praveen Raghavendra on May 4, 2009 12:08 PM -
How does iMatch determine when to "match" and when to upload?
Does anyone know how iTunes Match determines a match?
I have songs purchased from non-iTunes sources and, even though they are available in iTunes, iMatch is uploading them instead of "matching" them. Any idea why? Is there something I can change in the song info to make them match? Genre maybe? The artist, album, and song names match as best as I can determine, but maybe iTunes Match is expecting them to be slightly different, like capitalization differences or something? Anyone know?I'm very interested in this as well. I have dozens of ripped CDs that are also available on iTunes, but they didn't match. In some cases, it was one or two songs. In others, it was the whole album. For example, Beggars Banquest by the Rolling Stones did not get matches. U2's War was mostly matched, but a couple of songs were not. "Drowning Man" from War is 4:15 on the CD but 4:14 on iTunes. Is it as simple as that? I would think Match would work more from a signature (like the app Stanza) versus length and such. Those are too easy to get wrong.
-
How does one determine the amperage in macbook pro 5,4
I need to replace the battery for my MBP 5,4 and have tried about 4 or 5 by now and none of them are holding a decent charge by which I mean more than an hour or so. I've tried to educate myself on the meanings of amperage, mAh, watt hours, etc, etc, to determine what I need to look for in a compatible battery that may mean it'll last longer but I'm lost in the technicalities of the electronics field. Any guidance out there??
Yes, battery manufacturers are very imaginative with their specs (or what they leave out of the specs), you need 60 watts to run your Mac, extra is wasted. What the spec omits is how long the battery can supply it for.
Buy a genuine Apple one.
You get what you pay for, no more. (especially with expensive batteries)
But I do have one more query, does your Mac run hot? -
How does message determination work?
Hello,
I should print an consignment settlement with MRKO. How can I define different output type for different company? I guess I should search the solution in SPRO Material management - Logistics Invoice Verification - Message determination but I did not find the right way. Could anybody help me? Thank you in advance.you can make the different ouput types for each company in nace.
nace is transaction code.
Regards
Maqsood -
How does JEditorPane determine its preferred size?
Could someone explain how JEditorPane determines the initial preferred
size? Its default sizing is not giving me what I need and I'm not sure
how to control it, other than explicitly setting the size with
setPreferredSize().
A simple example:
String s = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 20" +
"21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39";
JEditorPane ed = new JEditorPane("text",s);
JPanel pan = new JPanel();
pan.setLayout(new BoxLayout(pan,BoxLayout.Y_AXIS));
pan.add(ed);
JFrame f = new JFrame();
f.getContentPane().add(pan);
f.pack();
f.setVisible(true);This code generates a window that shows one line, with "1 2 3 4 5 6 7 8 9"
showing. I'd like to have a larger area showing initially.
Does the choice of layout manager effect this? (I actually prefer to use
TableLayout; the above example with a 1x1 TableLayout and widths set to
PREFERRED yields exactly the same results.)
Thanks,
bwSet your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
From the Transform panel you can set a text box's width and height
Maybe you are looking for
-
I got ipad yesterday and i download facebook on it. But i cant login on it and i also cnt use internet banking on it. can you please tell me why?
-
Local vs. Remote Response Why such a delay?
I'm trying to find out why there is such a difference in query finish times and how to improve the time. ftp is fast between the machines. The network folks say everthing is ok there though the sniffer sees many Parses. Changing the arraysize in SQL*
-
Services configuration for sql server 2008r2 in a Windows Cluster
Hello, We have a Windows Server 2008 Cluster with Sql Server 2008r2 installed on node 2; when node 2 fails (we don't still know why, it's a 'bluescreen' long history), the service goes from node2 to node1, but sometimes the services are not automatic
-
How do I send a private message to a community member ? I tried the private message option it doesn't work .
-
Fellows Who can break down or explain for me these activities in SAP MM -Identifying Business process, -Designing current business flows, -Studying current business processes thanks rash