Get a new object saved in the cache to Toplink

Hello

I use Toplink 11 g Release 1 (11.1.1.1.0) on JDeveloper 11.1.1.1.0, driver JDBC 11.1.0.7.0.

I have a table named tblWords with the following columns (id, text) and a unique constraint on the text.
I created a sequence and a trigger on the table then when Toplink inserts a new Word it inserts only the text and returns the ID of the trigger.

Everything I do to insert the word is:
tblWords newWord = new tblWords();
newWord.setText ("Test");
m_uow.registerObject (newWord);

Now I s'pose a list of words that may contain duplicates. I ask Toplink to see if a word was previously introduced by:
Query ReadAllQuery = new ReadAllQuery (tblWords .class);
Manufacturer the ExpressionBuilder = query.getExpressionBuilder ();
query.setSelectionCriteria (builder.get("text").equal (parameter));

Vector < tblWords > words = (vector < tblWords >) m_uow.executeQuery (query);

If (words! = null & & words. size() > 0)
return (words.get (0));
on the other
Returns a null value.

It works very well if a word was already in the DB, but if the word list contains duplicates, the code returns null then registerObject will be called twice for the same text and a violation of uniqueness constraint is triggered when commit is called from Toplink calls INSERT tblWords (text) VALUES('Test') twice.

How can I query the cache for a word that I just created using registerObject without committing?

Thank you!

You should check for duplicate before you create them. Anyway, you cannot always prevent violations of constraints, because when the two operations run at the same time you do not see that the other transaction creates a duplicate until it is committed.

Same query with conform to the (recommended) active work unit you will return everything you have in the not yet committed UOW and what you have in DB. However, if you have auto RAS, and depending on which API you are using, the validation can be triggered before the query.

Tags: Fusion Middleware

Similar Questions

  • Im getting a new computer soon and the need to get the link to reinstall my Adobe CS3 (or 4)

    Im getting a new computer soon and the need to get the link to reinstall my Adobe CS3 (or 4)

    Hi Suzanne,.

    Please find the link below:

    CS3: download products CS3

    CS4: download products CS4

    Kind regards

    Sheena

  • I get a new PC, what is the procedure to install my old PC again Contribute?

    I get a new PC, what is the procedure to install my old PC again Contribute?

    If this isn't a CLOUD version, you install in the same way you did the first time... Put your installation disc (CD or DVD) in the drive and follow the instructions on the screen

    If it IS a Cloud version, you log your paid subscription of cloud and install from there

    http://forums.Adobe.com/community/contribute

  • How can I get a new tab automatically opens the display of the google search page?

    When I open firefox, I see my google home page, but when I opened a new tab it shows the homepage of searchnu. It used to be empty and I don't know how or why he changed it, but can you tell me how to get my tabs automatically opens showing www.google.co.uk please?

    COR - el, please stop automatically repost these unnecessary links and provide some specific measures, provable and reliable to get rid of the searchnu.

  • Get a new graphics card for the HP Envy 700-214

    Hello

    So I tried to get a new graphics card for my HP Envy 700-214, but I'm not aware if this map is compatible or if it would have a negative impact on my system.

    http://www.GeForce.com/hardware/desktop-GPUs/GeForce-GTX-750-TI/specifications

    I don't want my system to be harmed in any way.  Here is the link to the computer.

    http://support.HP.com/us-en/document/c04100558

    Thank you!

    Wolfking98, welcome to the forum.

    Here is the video card manufactured by EVGA.  It shouldn't harm your system somehow.  However, if you have trouble with the installation, you can contact their Technical Support (1-888-880-3842) or online.  They were very useful for me.  Read the reviews to see what users have to say about it.  As you can see, there are a lot of comments and appreciation 5 eggs.  You can't do better.

    Please click on the Thumbs up button '+' if I helped you and click on "Accept as Solution" If your problem is resolved.

  • Satellite U500 - where to get a new HARD drive during the warranty?

    Hello world

    I bought my Toshiba Satellite U500 some months in London, and a few days ago my hard drive starts to give me a such difficulties that do not correctly read and given the weird sounds. And finally at boot up to yesterday, its giving me this message "Pri Master hard disk: extended S.M.A.R.T. Status BAD, Backup and replace, press F1 for cont...» »

    Now, I realized that I need a new HD and that one is not usable. What I was wondering, is it possible to keep in touch no matter what service provider Toshiba in order to get the new HD cos this machine is almost brand NEW.

    Can someone give me an advice what to please, it would be much appreciated.

    Thank you

    Hi Edward_4,

    I agree with you. You need a new HARD drive as soon as possible because it s not recommendable to record data on a failed HARD drive.

    In any case, it should t be a problem. You must contact an authorized service provider and explain the situation. Technicians can order a new HARD drive for you and Exchange. This should be free, because your laptop is under warranty so it s age of a few months.

    On the Toshiba site is a list of all s ASP. This seems to be your interlocutor ;)
    http://EU.computers.Toshiba-Europe.com > support & downloads > find an authorized service provider

  • I just bought a MAC pro. I signed in but none of my apps to my other apple devices are in section purchased from iTunes. How can I get this new macbook to access the apps I bought before I bought the macbook?

    I just bought a macbook pro. I failed to access applications that have been purchased before buying the macbook. I use the same apple ID. How do you get apps already purchased?

    Hi SupaDupaTrini,

    If you don't see the applications you have previously bought for download, I would first examine the history of your purchases using iTunes on your MacBook Pro software:

    See your purchase history in iTunes on Mac or PC store
    https://support.Apple.com/en-us/HT204088

    If you do not see your purchase, it can be hidden. Learn how do to hide or show items in your purchase history.

    If you can't find an item that you purchased from the iTunes Store in the last 90 days, report a problem. For older purchases, contact the iTunes Store supportand some purchases, billing and redemption.

    Download your latest purchases
    https://support.Apple.com/en-us/HT201272

    Before you can access a purchase, you must do the following:

    1. To log in with the Apple ID you used for the original purchase. Use the following steps to see what Apple ID allowing you to download something.
    2. Check if the purchases you are looking for are hidden. If your purchases are hidden, you can see them not even after following the steps below. Learn how to view purchases.
    3. See if content is available for the redownload. Previously purchased may not be items not available if they are no longer on the iTunes Store. Also, make sure that you are in a country whereyou can redownload points. If you have changed your Apple ID from one country to the other, you cannot download items you purchased in a previous country.

    Take care

  • How can I get a new IP setting for the adapter "Local Area Connection"?

    Recently I get the above message & I can't access the Internet. I have Vista 64-bit

    using the default setting, the IP address is assigned to the devices in a network, among a range of addresses by the router.

    Try uplugging the router and modem, wait about a minute and plug their return, this may help.

  • Cannot get my new office to recognize the second monitor.

    Original title: multiple monitors

    My new desktop running vista computer will not recognize the connection of the DVI cable to my old monitor, who was formerly connected by analog on my laptop. What should I do?  The cables are correct and the correct entry site.

    Try this:
    Right click on the desktop-> graphics options-> output to-> dual display. You can also do it on your graph icon on the Notification area.

  • How to get a new column without using the update (Please check with the requirment)

    write a query to display the current sal and the new sal for all employees

    condition
    If job = 'MANAGER' and deptno in (10.20) and then newsal has increased by 15% to the current salary.
    If work! = 'MANAGER' and deptno in (10.20) and then newsal has increased by 25% to the current salary.

    Select ename, sal as old_sal,
    -CASE when work = 'MANAGER' and deptno in (10,20) then (sal + (sal * 15) / 100)
    When job! = 'MANAGER' and deptno in (10.20) and then (sal + (sal * 25) / 100)
    Another Sal
    END as new_sal
    EMP;

  • FF10 will get a new version to correct the problem of "small website"?

    After the upgrade to FF10 3.6.26, all websites are made very small. (Win7, screen resolution 1920 x 1080, with settings appropriate font OS.) All applications except Explorer appear very well.

    It is necessary to zoom in manually each web page to make it readable. FF10 themselves appear also, very small. For example, the icons in the bookmarks toolbar are so tiny, it is difficult to see, and the close-tab button is so tiny that it is essential to operate the very precise mouse positioning.

    IE doesn't do this, nor FF 3.6.26. IE seems to make a website in proportion to the available screen real estate and FF 3.6.26 was perfect! Why not FF10?

    Is FF10 just a browser for smaller screens then? Will there be a updated version that resolves this problem?

    You can use an extension to set a page zoom and the size of the default font on the web pages.

    This extension allows to adjust the font size for the user interface:

  • I'm getting a new computer. On the old computer, in addition to simply delete the files, what should I do before disposing of it, he? Will my information be always on the computer?

    Afraid to throw old computer with information on this subject.

    Afraid to throw old computer with information on this subject.

    You're going to throw the computer, not give it or sell it?

    Physically destroy the hard drive. Retirer withdraw the case, open it, break it with a hammer, etc.

  • I can't turn on windows Defender, if I erase it can and will I be able to get a newer version of microsoft, the site says it is part of the service pack and used to download.

    im running on a computer point of sale of Wal-Mart.  you are using windows vista. service pack 2.

    Here's the Microsoft tutorial Support regarding error 0x800106ba code:

    Error message when you run Windows Defender: «Error 0x800106ba»

    http://support.Microsoft.com/kb/931849

    There are 3 methods listed. I hope one of them can help.

  • Help! How do you keep objects in the same order in a doc page 20, when inserting a new object?

    I created a catalog of photos only, as objects.

    They are organized in alphabetical order, 4 images per page as a 2 x 2 grid, 20 pages.

    I want to insert a NEW object (image) in the middle of these 20 pages, and you want all objects after the move more than a place to make room.


    How can I get the objects after those inserted to shift, such that the text would be the case if you have inserted a text more in the middle of a paragraph?

    I can't understand how this (without just putting the images in a text box and online, but then I lose all the controls of the space)...

    Thank you!

    Laurent

    The only possibility would be a script. Scripting InDesign

  • Expulsion of objects based on the aging of the dimensions of time and no cache

    Hello
    II uses a cluster of coherence (extend) and wish to implement a policy of aviction for each object inserted into the cache.

    Documentation, I read I understand political custom eviction are ALL size based and not time based (way, expulsion is triggered when the cache is full and not hide when the aging of the affected object time).

    It there a way to implement these evictions?

    Hi Reem,

    When you say that you want to trigger my own code/class at this end of the cache item what exactly do you mean?

    1. don't you want to control what happened to expire?
    2. don't want to trigger a treatment when the entries are expired?

    If it is 2, then you can use a normal cache listener. In the entryDeleted of the MapListener method you can cast a delete the MapEvent isSynthetic CacheEvent and call that returns true if the event is due to expulsion or false if the event is due to a real.

    JK

Maybe you are looking for