Integrate Hibernate L2 cache with consistency in the composite key of reference

Hi all:
I have a problem when I activate the Hibernate l2 cache integrated with consistency. When the entity class using this string or unique integer primary key, the L2 cache has worked well. But when I use the entity with composite key class, I had the problem.
I wrote a script to test junit to test the session.get method, when I run the test cases for the first time, the miss of the entity to load the object from the cache, Hibernate will trigger a DB query so it box as an object, then put it in the cache. But when I run the test case, again, I found the Hibernate trigger a query once again, which was strange... (it should not have happened, I should got the object from the cache), then, I used the console cache coherence to list the data in the cache and finding himself under the information:
###########################################
(Hi) map: list
model. SiteUserInfo #model. SiteUserID@323819 = Item {version = null, freshTimestamp = 1333943690484
model. SiteUserInfo #model. SiteUserID@323819 = Item {version = null, freshTimestamp = 1333943600419
###########################################
There are two keys with the same value cached... (I put already implemented method hashcode and equals to SiteUserID object). someone there has the same problem? Or L2 Hibernate with composite key can integrate with consistency?

Rip off code SiteUserID
#####################################
@Override
public boolean equals (Object obj) {}
If (obj == this) {}
Returns true;
}
If (!) () obj instanceof SiteUserID)) {}
Returns false;
}
SiteUserID id = (SiteUserID) obj;
return new EqualsBuilder () .append (sid, id.getSid ()) .append (name, id.getName ()) .isEquals ();
}

@Override
public int hashCode() {}
return new HashCodeBuilder () .append (sid) .append (name) .toHashCode ();
}
###################################

Hi John,.

I think there may be another problem.

Please reference:
http://blackbeanbag.NET/WP/2010/06/06/coherence-key-HOWTO/
For entry cache, partitioned cache is placed in backup card in binary form.
The main objects of the same data must always be serialized in binary form even.

Unfortunately, use Hibernate CacheKey is as key cache L2.
And CacheKey is somewhat complex, some related attributes use TreeMap as their type.
"Java gives no guarantee on the order in a hash table and serialization is dependent on the command."
(reference http://stackoverflow.com/questions/9337126/how-can-oracle-coherence-get-fail-with-retrieved-key-object)

So... you may need to modify the source code of some Hibernate, ex: replace the FastHashMap in TreeMap...
I tried, it looks like work. I'll send you have modified source codes.

Best regards
Leon

Tags: Fusion Middleware

Similar Questions

  • Cannot change the brightness on Toshiba Tecra S11 with Win7 using the FN keys

    I can't change the brightness on Toshiba Tecra S11 with Win7 using the FN keys (disable audio and other work fine) when logged in as a normal user.
    Shortcuts keyboard console appears and pressing F6 or F7, the brightness is always set to level 1 (no matter how luminous monitor is really) and cannot be changed.
    I can change it via power or Administrator Options.

    Hello

    Maybe you didn't install VAP (value added package) for all user accounts.
    Please reinstall VAP by using your user account.

    You can also check if the user account is the Admin right supported.
    You can run simple applications (exe) as an administrator.
    For this, he must right click on exe file (value package) and should choose + Run as administrator. +

    Check it!

  • I had Photoshop CS for a while. I use it for one purpose, which is to standardize my bronze products photos, all photos are identical with regard to the composition, lighting, backgrownd, actually, I always place the same scale of assessment pr

    I had Photoshop CS for a while. I use it for one purpose, which is to standardize my bronze products photos, all photos are identical with regard to the composition, lighting, backgrownd, actually, I always place the pillar of satisfaction even scale and then only switch products bronze... a simple task of worm. For this reason I have is no need to upgrade my old version of Photoshop. My problem is that it doesn't work anymore since Windows 10 recently installed in my PC. IO have tried to install it several times but can't. Is anyone out there help me please!

    Activation for CS is closed. Adobe provides you with a free replacement of CS2.

    Uninstall CS

    Go here: Download Adobe Acrobat 7 and Adobe Creative Suite 2 products

    Click English, download Photoshop CS2 and also copy the serial number that comes with it.

    Install CS2 and use this serial number CS2. There no need activation.

    Take your copy of the CS, it is no longer usable.

  • Index on the Composite key to solve enq: TM - contention

    Version: Oracle 10g

    Hello

    I had enq: TM - restraints in my database, and I want to apply the index on the foreign key of one of the table column.

    But I see there are composite foreign keys and foreign keys unique in the table.

    Only foreign key I can easily create the index, but my doubt is that, for a composite foreign key,.

    Do I need to create the composite indexes on each column of the composite key or composite foreign key columns, I have to apply clue to solve the enq: TM - restraints question.

    For example: I have a foreign key below

    "FK_RECONDATA_DRIVER" CONSTRAINT FOREIGN KEY ('NRT', 'DADDRESSTYPE', 'DADDRESSNR')
    REFERENCES 'COL '. "" TURN ON THE FAZGFUEHRER ' ('NRT', 'ANSCHTYP', 'ANSCHNR'),
    "FK_RECONDATA_PRODUCT' FOREIGN KEY ('NRT',"PRODUCTNR") CONSTRAINT
    REFERENCES 'COL '. "" ENABLE SORT "("FNR","SORTENNR")

    Here the column FNR is common in both the foreign key.

    Please help me find how to create indexes on these columns.

    An index defined as ind_fk (a, b, c, e, f) will cover (1) (a) FK and FK (a, b, c).

    It however will not cover FK(a,e,f) because it does not start by all the columns of the FK.

    You must create an additional index that begin with (a, e, f).

    Best regards

    Mohamed Houri

  • I have a problem with access to the bitlocker key.

    Original title: my surface said rt I need bitlocker recovery key, but my information was not correct on said account have wait until March to access my email account and get the key?

    Basically, my phone number was incorrect, so I had the chane it now I can't access my recoverykey skydrive until 25 March, what am I supposed to do? as I can not access my surface?

    What happens if you following this link:

    For your recovery key, go to BitLocker recovery keys.

    ( http://go.microsoft.com/fwlink/?LinkId=237614 )

    This should send the recovery key for the mobile phone to the folder number.

    I found this link on this page of the FAQ Bitlocker recovery key:

    http://Windows.Microsoft.com/en-us/Windows-8/BitLocker-recovery-keys-FAQ

    If this does not help, you may need to contact support Surface.

    Kate

  • Problem with States within the composition on the subpages only

    I use a composition to create and menu/fly on boxes of content. So far, it it show I want. The problem is when I go to another page in the site, the styles do not stick to the menu/composition States.

    It is very obvious if you go to this link:

    Home

    Fly over the AREAS of PRACTICE and then click on INJURY. Once on the page of the injury, you can see that the applied styles do not stick on the 'normal' State of the menu.

    It is meaningless since it's the same master page, that I use for the home page and States and the styles are there.

    I appreciate the help that anyone may be able to offer!

    Thank you!

    Hmm, if you wish you can send me your .muse file in a private message and I'll have a look in a bit. If you do, please DO NOT send any personal login or password. Just the .muse file is all that is necessary.

  • CQL Join on the coherence of Cache with Composite key

    I have a coherence of Cache with a composite key, and I want to join a channel for the records that cache with a CQL processor. When I deploy the package that contains the processor, I get the following error:

    + italics14:32:35, 938. modify the beginning of query SimpleQuery | [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.
    + 14:32:35, 938. change query > > SimpleQuery < < start +.
    + specified predicate requires a comprehensive analysis of the external source that is not supported. Please change the join predicate. [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.

    I think I use the key. If I change the key to a single field, it is OK. I found a similar problem when I defined a Java class to represent the composite key. It is possible to join this way on a composite key cache?

    I could define another area that is the concatenation of fields in the composite key, but it's a little messy.

    My config is as below:

    < wlevs: caching system id = "MyCache" provider = 'coherence' / >

    < wlevs:event - type-repository >
    < wlevs:event - type the type name = "SimpleEvent" >
    < wlevs:properties >
    < name wlevs:property = 'field1' type = "char" / >
    < name wlevs:property = 'Field2' type = "char" / >
    < / wlevs:properties >
    < / wlevs:event - type >
    < / wlevs:event - type-repository >

    < wlevs: channel id = "InChannel" - type of event = "SimpleEvent" >
    < wlevs:listener ref = "SimpleProcessor" / >
    < / wlevs: channel >

    < wlevs:processor id = "SimpleProcessor" >
    < wlevs:listener ref = "OutChannel" / >
    < wlevs:cache - Ref source = "SimpleCache" / >
    < / wlevs:processor >

    < wlevs: channel id = "OutChannel" - type of event = "SimpleEvent" >
    < / wlevs: channel >

    < wlevs:cache id = value 'SimpleCache"type ="SimpleEvent.
    Properties-key = "Field1, Field2.
    system caching = "MyCache" >
    < / wlevs:cache >

    and the processor CQL is as follows:

    < processor >
    < name > SimpleProcessor < / name >
    < rules >
    < request id = "SimpleQuery" >
    <! [CDATA]
    Select I.field1, I.field2 from InChannel [now] as I,
    SimpleCache as S where
    I.Field1 = S.field1 and
    I.Field2 = S.field2
    []] > < / query >
    < / rules >
    < / processor >

    Thank you
    Mike

    Unfortunately, join him on composite keys in coherence is not supported in the released versions. He will be supported in release 12g.

    As you mention, setting another field as the key, which is the concatenation of the original keys is the workaround.

  • Identify the foreign key table

    I have a table that has a few constraints that are foreign keys to other tables (see column FK_ETHNIC below). My naming conventions are consistent so they all start with 'FK_ ". In SQL, how can I find the table that the foreign key column references? I have a process that must find this table and then get all of its columns.
    Thank you!

    CREATE TABLE STU_BASE
    (PK_ID VARCHAR2 (32), sys_guid() by default)
    CONSTRAINT pk_stu_base
    KEY ELEMENTARY SCHOOL
    With the HELP of INDEX TABLESPACE sis_express_index
    STORAGE (INITIAL 524288
    NEXT 524288
    PCTINCREASE 0),.
    STUDENT_ID VARCHAR2 (15).
    Fk_stu_base_ethnic FK_ETHNIC VARCHAR2 (32) CONSTRAINT
    REFERENCES
    Ethnic (PK_ID)
    REMOVE THE NULL VALUE;

    CREATE TABLE ETHNIC
    (PK_ID VARCHAR2 (32), sys_guid() by default)
    CONSTRAINT pk_ethnic
    KEY ELEMENTARY SCHOOL
    With the HELP of INDEX TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0),.
    VARCHAR2 (2) ETHNIC,.
    ETHNIC_DESC VARCHAR2 (30),
    STATE_CODE VARCHAR2 (2),
    FEDERAL_CODE VARCHAR2 (2))

    You could do a self-join with CONSTRAINTS (USER, ALL, s/n) views. You can search a constrainttype of 'R' and you can attach it to itself based on the R_OWNER and R_CONSTRAINT_NAME columns.

    For example:

    SELECT r1.owner      AS child_owner
         , r1.table_name AS child_table
         , r2.owner      AS parent_owner
         , r2.table_name AS parent_table
    FROM   all_constraints r1
    JOIN   all_constraints r2 ON  r2.owner           = r1.r_owner
                              AND r2.constraint_name = r1.r_constraint_name
    WHERE  r1.constraint_type = 'R'
    ;
    

    Published by: Centinul on February 16, 2012 15:36

  • Re: Satellite has - how to restore the functionality of the FN key?

    Once from time to time (perhaps after a few updates?) the FN key doesn't work. What should do? I tried to install the update to the BIOS on the Toshiba site - the version already is 190.

    Hi idof,.

    It would be useful that post you some information about the operating system and your model of laptop. I can t find in your ad.

    With regard to the FN keys: in your case I would try to update package of added value and utility to Support Flash Cards. It should work :)

  • 2015 Macbook: keyboard product strikes without touching (for only the T key)

    I have a Macbook or 2015 in perfect condition, original owner, never damaged, still under warranty. A few months ago, I noticed that the T key would occasionally insist on its own. With nothing, contacting the keyboard, keys T would have picked up.

    There has been sporadic for a few months, then a few weeks ago, it became much more common. I only use the computer because I disabled the T key using the carabiner and remapped Cmd + 5 so that it sends that t. typing is not easy, so maybe you can forgive me if my message is short?

    Has anyone experience this problem or have any recommendations? Thank you!

    Could be something as simple as small pieces of debris that may have gotten

    trapped under the key - and once there, could interfere with spring

    parts below. You could read through another debate where I made

    post links to some sources on how to clean the keyboard without taking

    Apartment. With... canned air that one is an Apple support article.

    There are also other links to the iFixit site where the keys of the keyboard are

    shows removed and the section of spring is as well. There were two answers

    to the original question of the user because the first expired while I did some research.

    Re: Enter issues -problems of keyboard macbook 12 inch retina

    Re: Enter key 2 issues -key-face and spring cleaning info button

    Details to some extent are covered, and there is also a link to consider a

    Appointment of genius Apple Store, if you want them to look over

    and they may be able to clean it up during your reserved time; or, if

    no official retail Apple Store is available, maybe (if you do not want to)

    an Apple authorized service provider may; a genius would be free of charge

    to watch over and examine it. Under AppleCare, likely repairs are covered.

    However this is equivalent...

    Good luck & happy computing!

  • Vista error "the product key you entered is already in use"?

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    I bought Windows Vista Home Premium two years ago and now an activation window appears with a message "the product key you entered is already in use" I kindly ask for an explanation and a solution

    Activation by phone:
    http://www.Vistax64.com/tutorials/84488-activate-Vista-phone.html

    Scroll down to step 2: how to do a phone Activation.

    Note: if the activation service you informs that it has failed and cannot help with activation, thenSTAY ON THE LINE and your call will be transferred to an operator of activation which will help you to activate your copy of Vista.

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • Is the product key that appears on the back of my PC for my Office 2010?

    Microsoft Office 2010 is a software that is came with my PC HP TouchSmart I finally found the product key or I think that I found the product key? At the back of my PC has a sticker labeled "Window 7 Home Prem OA HP certificate of authenticity Label not not for sale separately with 25-character alphanumeric text." I typed this alphanumeric information in the text box of my Microsoft Office 2010, which I've never been able to because I don't have the product key information, until I found the sticker pasted on the back of my PC. I looked in the box when I got my PC and have not found anything that related to this software or where to find the product key. I was under the impression that I don't have the right to this software because of the product key was not available to me at this time. I tried to open a "word" with another software, I received a product that I bought and the Microsoft Office 2010 window still open, but I could never use I decided to search for the original again box and I turned my PC and found the label on the back of my PC. I typed in the information and the answer I got is 'This is not A valid product key Office' I launched the 'learn more about keys and see examples of products' and this is were I am now. Can anyone explain what is happening with this software, the product key, or is not what software came with my PC I always thought?

    I bought this PC QVC in 2011.

    Original title: Microsoft Office 2010

    This product key on the COA sticker is not intended for Microsoft Office 2010. That came with your copy of Windows 7 is a trial version of office, you must either purchase a license or upgrade to Office 2013 or Office 365.

    Windows 7 product key located on the certificate of authenticity attached to your system, label that does not work, it's only for Windows 7. You need a product key Office 2010.

    If your computer comes with a trial version of Office, you need to get a trial key or buy a full license:

    Trial license:

    http://Office.Microsoft.com/en-us/try/

    Full license:

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

    Get the key;

    http://Office.Microsoft.com/en-us/buy/redir/XT101874326.aspx?CTT=5&origin=HA101847520

    If you purchased Office 2010 and get no valid product key error to refer the article mentioned below:

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

    Frequently asked questions about Office Activation Wizard and about features in Office 2010 and Office 2007 programs view programs

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

    Error message when you start an Office application after installing a suite Office: "invalid product key".

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

    If you have a trial version of Office 2010 that came with your computer, try to uninstall it first:

    Run the patch tool mentioned in the article below to uninstall Office 2010:

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

    Download a trial version of Office 2010 that corresponds with the edition that you purchased and convert it to a version full:

    Trial license:

    http://Office.Microsoft.com/en-us/try/

    See the link on how to convert a trial version of a suite full Office 2010 or program to a commercial version: -.

    http://Office.Microsoft.com/en-us/project-help/convert-a-trial-version-of-an-Office-2010-suite-or-program-to-a-full-retail-version-HA101886436.aspx

    http://Office.Microsoft.com/en-us/buy/convert-your-trial-to-a-full-product-version-HA101812668.aspx?CTT=1

  • need to based on the primary key of different table 2 foreign key constraint

    I'm using Oracle 11.2.0.3.

    I have 2 table invl with invl_pk as primary key and org with org_pk as the primary key.

    In the third table entity_list, I have entity_pk that can be indvl_pk or org_pk.   How can I create this constraint?

    Thanks for your time.

    Hello

    Assuming that your model is correct, then what you describe is a normal type of ER modeling construction known as a relationship of the CRA. It is characterized by an entity with two or more links that are mutually exclusive to each other (XOR). A typical example may be where a person entity and an entity of the Organization relate both to a bank account entity, but a bank account can only be used by a person or an organization in a mutually exclusive way. In order to serve this on a diagram, an arc is drawn between effective relationships on the side of the child, where the name of a relationship of the CRA.

    Google will be of multiple examples and explanations.

    In a perspective of physical databases, this can be implemented in general in two different ways.

    1. assuming that all parents in the relationship of the CRA have identical PK, that is to say, a number that is generated, the child may have a FK of the same type and an entity of type column that defines what entity the FK is. The advantage of this is that it is a bit more compact and is expandable without schema changes if you want to add more relationships. The downside of this is that the CF cannot be defined at the database level and will build on the code to be executed or both in the application and the database as a trigger.

    2. regardless of types PK for parent entities, the child has a separate optional FK appropriate for each relationship in the arc. Each FK is defined at the database level while maintaining the exclusivity of relationships, a constraint is defined on the table that prevents several FK being filled for a given instance. This can be a little messier that there must be a (column/s) FK for each relationship in the arc, but the relationship may be limited to the level of the object database with the help of FK constraints and a check constraint. This could also be considered to be more technically correct implementation.

    Hope this helps

    André

  • Obtain the IPTC metadata field "reference" appears?

    I use Apple's Aperture to organize my photos, but my friend uses Lightroom. I don't know about Lightroom. When I send a file (JPEG) with data in the metadata field "object reference", he says that he cannot set up Lightroom to display this field. I need to know how, as in Aperture, it is possible? Surely it can be?

    I find it strange that Lightroom does not behave as a snippet does on the Mac; to know that even if a metadata field is rarely used (and often does not appear in the usual properties pane) it will be if the data inside.

    Thank you very much.

    According to this document, they are the same field and as I indicated above, IPTC subject Code appears when you view all metadata in LR.

    http://www.ianfarlow.com/temp/a2_iptc.PDF

  • Integration of the CEP with consistency

    Hello

    I'm trying to integrate CEP with consistency. I want to achieve is that, I want to push the event out of the CEP processor in the cache consistency and use it in the CQL queries in the processor of the CEP.

    Is there a document or a Web page that has the steps to follow in the CEP integration process and consistency. Please give the information reg.

    Thank you
    Regnier

    Raj,

    Here is a white paper on the CEP of the Oracle and consistency as well as a sample application:

    http://blogs.Oracle.com/CEP/2008/12/oracle_cep_and_coherence_white.html

    -Luk

Maybe you are looking for