Help needed to sync cache with the database using CacheStore

Hi,
I need to have my cache in sync with the database. I followed the tutorial to create a DBCacheStore class which will act as a CacheStore between Cache and my Oracle database. My Cache-Config file contains
<backing-map-scheme>
                    <read-write-backing-map-scheme>
                         <internal-cache-scheme>
                              <local-scheme></local-scheme>
                         </internal-cache-scheme>
                         <cachestore-scheme>
                              <class-scheme>
                                   <class-name>com.coherence.cacheUtil.DBCacheStore</class-name>
                                   <init-params>
                                        <init-param>
                                             <param-type>java.lang.String</param-type>
                                             <param-value>{cache-name}</param-value>
                                        </init-param>
                                   </init-params>
                              </class-scheme>
                         </cachestore-scheme>                         
                    </read-write-backing-map-scheme>                    
               </backing-map-scheme>
Now, what I am trying to achieve is,
1. Load the cache with values when the cache server is up, without any need to run separate program
2. Integrate all read/write cache operations with the database
I am aware that CacheStore class implements store, storeAll, erase, eraseAll, load, loadAll methods from undelying interface and I need to write corresponding code to add/remove/update records in the database.
But, I am really not sure how and when to include the logic to load the cache with the data from the database when the server is up.
Thank for the help. Much appreciated!

Could you try something like this to load the cache?
HashSet buffer=new HashSet();
s = conn.createStatement();
rs = s.executeQuery("select key from table");
while (rs.next())
String key = rs.getString(1);
buffer.add(key);
// this loads 1000 items at a time into the cache
if ((count++ % 1000) == 0)
cache.getAll(buffer);
buffer.clear();
if (!buffer.isEmpty())
cache.getAll(buffer);
This web page also gives a good example:
http://www.oracle.com/technology/pub/articles/vohra-coherence.html
-Luk

Similar Messages

  • HT203311 I am use homesharing, but cannot sync the main library from the secondary computer to an iphone.  It shows the entire libaray on the computer, but only shows a few songs when I try to sync iphone with the computer using homesharing.

    I am use homesharing, but cannot sync the main library from the secondary computer to an iphone.  It shows the entire libaray on the computer, but only shows a few songs when I try to sync iphone with the computer using homesharing.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Help Needed!! Working with SQL Databases

    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Solved!
    Go to Solution.

    tdog wrote:
    Hi All,
    I'm currently working on an application that interfaces with an SQL database, and I seem to have ran into a roadblock.
    I have a multicolumn list box on my front panel which is filled in with data extracted from the database. On selecting any of the rows in the list box, another one is opened displaying another set of data extracted by a generated SQL query. At the moment I am only selecting one row at a time to view it's related data, but I want to expand such that I can select mutiple rows from the list box at a time and see all of their corresponding data.
    With only a single selection, I can pass the index value of the selection to an Index Array Function with the database as the other input and build my SQL statement.
    But with multiple selections, I imagine I would have to build an array on index values and use those as a reference to build the SQL statment. And I am not sure how exactly to go about doing that.
    Here is the code that I currently have working for a single selection from the list box.
    Any help is appreciated. Cheers.
    Regarding building the array:
    I can see hat you multicolumn listbox has not multiselection enabled, and is limited to one or zero selected item at once. To enable multiselction; simply rightclick your multicolumn listbox and change your selection mode to support multiple selected items. The NewVal at the event structure should change from a single index number to a 1D array of indexed numbers. No coding needed. Then just retrive out all the items (since you know the indexes) and create the quiry. The quiry part I dont really know (long time no see SQL), but it looks like a for loop to create the string should do the trick?

  • Help, need a card compatible with the Platinum Live bay that uses the SB Live E400 midi dri

    Help , have just got a used Soundblaster Li've Platinum card and i/o bay to ease in the production of backing tracks for li've gigs etc, my old card is a li've value soundblaster that uses a Midi driver called SB Li've E400 in addition to the Sb Li've A400 and the B400 which i used to assign soundfonts etc because they are not suitable for bass and drums ,very soft sounding but i need the Sb Li've E400 to get the loud and powerful drum and bass sounds so important for my work, the Platinum set has a card Model number sb0060 and the midi input driver is called MIDI UART with midi outputs being Sb Li've UART which results in no audio o/p if assigned to a midi channel and the Li've synth A and B ,similiar to my li've value card . my Soundblaster value card is a sb0220? allthough the Platinum card is great for plugging guitars straight in and the optical output is great for recording onto mindisc the sound quality is crap,not in the same class as my old li've value card? anyone got any ideas,dont know where to go next? Cheers George.

    wouldnt put 2 sound cards in but you could try attaching the sb li've dri've to card, it will either work or it ownt, it will not work with remote, but it may just work as an io panle for your mid etc..
    However if it was my hardware i would try as thats my right and my hardware i may break, so you would do this at your own risk.

  • HT201342 Help needed On sync process with devices and photo stream keeps multiplying pics ?

    Older generation trying to acquire a savvy touch for apple products needing lots of help!  Is there anyone out there interested in assisting in all phases of learning ....

    Older generation trying to acquire a savvy touch for apple products needing lots of help!  Is there anyone out there interested in assisting in all phases of learning ....

  • What is the best way to create fields at runtime in the database using JPA?

    We use Oracle ADF platform to build web applications and extend to webcenter portal application.
    The current expectation from Java developers team is to change our development approach/method, so that adding some fields in the application should not required any development effort. In other words, when you want to add a data field (at least no relation to any field) in some form, it should be enough to save some metadata of the field to the database along with execution of related job/commands in the application. Additionally, we need to render the view dynamically according to added fields.
    Essentially, I think that such an expectation is not suited for the Java world, but if it could be possible or if someone has prior experience to do this, I would want to use it. We don't want to be interact directly with the database using native SQL through JDBC, as that would mean going out of the ADF framework.
    Suppose that, we define the metadatas of custom field(s), for example its type(string, number, combobox etc)length, isunique, mandatory... And then we run the execute command of this field definition to create on database and map to related entity object from now on. I assume that might be possible to add entity class as property belonged to class. Anymore when rendering the page, new custom field must be shown in form view if even there is no deployment process...
    There is Extensible Entity in EclipseLink. Has anybody got sample project about used eclipselink extensible entities? I could not find enough detailed docs unfortunatelly
    http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Extensible_Entities#EclipseLink.2FUserGuide.2FJPA.2FAdvanced_JPA_Development.2FExternal_Mappings
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic#Usage_Examples
    http://flex.winfxpro.info/download/?noderef=workspace://SpacesStore/af69ebfb-6d9f-4a03-8244-c56100d16deb

    In the persistence.xml specify the property
    <property name="eclipselink.ddl-generation" value="create-tables"/>
    But, a JPA implementation is not required to create tables according to the EJB 3 JPA specification. The Hibernate persistence provider does, the EclipseLink doesn't.
    <provider>org.hibernate.ejb.HibernatePeristence</provider>

  • Hi, I need help and advice. Basically me and my ex partner both had iphones and synced it with the same computer under the same ID. We split i have a new laptop and now it keeps asking for the old ID or it'll erase my apps bought on theold account.

    Hi, I need help and advice. Basically me and my ex partner both had iphones and synced it with the same computer under the same ID. We split up and now im trying to get all my apps and info onto my new laptop with a new account but it keeps asking me for the old apple ID which she is still using and she changed the password. i tried backing it up but still nohing. When i try to back up purchased items being apps etc its keeps asking for the old one. help

    See Recover your iTunes library from your iPod or iOS device. But you'll still need the password.
    Once you have the computer authorized to use the account she could change the password again to stop you buying apps on her card (assuming it's not on yours!). It would lock you out of upgrading them too but they should work unless she uses the deathorize all feature.
    It depends on how amicable the split is...
    tt2

  • After REFRESH the cached object is not consistent with the database table

    After REFRESH, the cached object is not consistent with the database table. Why?
    I created a JDBC connection with the Oracle database (HR schema) using JDeveloper(10.1.3) and then I created an offline database (HR schema)
    in JDeveloper from the existing database tables (HR schema). Then I made some updates to the JOBS database table using SQL*Plus.
    Then I returned to the JDeveloper tool and refreshed the HR connection. But I found no any changes made to the offline database table JOBS in
    JDeveloper.
    How to make the JDeveloper's offline tables to be synchronized with the underling database tables?

    qkc,
    Once you create an offline table, it's just a copy of a table definition as of the point in time you brought it in from the database. Refreshing the connection, as you describe it, just refreshes the database browser, and not any offline objects. If you want to syncrhnonize the offline table, right-click the offline table and choose "Generate or Reconcile Objects" to reconcile the object to the database. I just tried this in 10.1.3.3 (not the latest 10.1.3, I know), and it works properly.
    John

  • HT1692 Have recently installed itunes and outlook on a new computer.  Have multiple email accounts set up in Outlook tho only use contacts and calendar in relation to one of these. Cannot sync itunes with the correct contacts and calendars, Help!

    My new computer is 64-bit running Windows 7 pro, SP1 and Microsoft Office 2010 Pro Plus 32-bit
    My phone is a 4S runing iOS 6.1.3
    Very frustrated now that I have recently installed itunes and outlook on this new computer.  Everything worked perfectly ok on my laptop which was also 64-bit Windows 7 and running 32-bit Microsoft Office 2010 Pro.  I have multiple email accounts set up in Outlook tho only use contacts and calendar in relation to one of these. Cannot sync itunes with the correct contacts and calendars, when I sync the calendar and contacts are empty.  Not sure if there is any way to point itunes to particular address books and calendars.
    I have installed and uninstalled itunes 3 times and thank goodness have a backup
    Can anyone help please?
    thanks in anticipation

    I had my home computer set up to sync to work's Exchange server. It worked well, but I didn't like seeing work email messages and other programs trying to sync with my default Outlook folder, which was then the Exchange (& work related) .ost file. I know there are various ways to manage those problems using filters, view, subfolders, etc., but it was a hassle for me. I think it could work well for many other folks.
    For now, I have published my work calendar and subscribed to that calendar on my home computer. So I have view only access to my calendar on my home computer (and I can add/edit calendar items on my iPad (or Outlook Web Access) when away from work). This is not quite what I wanted, but it may work.
    It almost makes me long for the days when I used my Windows Mobile Treo to sync back and forth between exchange at work and outlook at home (but had many sync conflicts as a result).

  • I have changed my Apple ID name and I want to change it on iCloud, however I am not able to delete the previous account because I need to turn off the Find my iPhone - and for that I need to log in with the old name and that is not working. Help anyone?

    I have changed my Apple ID name and I want to change it on iCloud, however I am not able to delete the previous account because I need to turn off the Find my iPhone - and for that I need to log in with the old name and that is not working. Help anyone?

    Hey tulgan,
    This link will provide information on what to do after you change your Apple ID:
    Apple ID: What to do after you change your Apple ID
    http://support.apple.com/kb/HT5796
    Welcome to Apple Support Communities!
    Take care,
    Delgadoh

  • Entity Bean Rollback fails: caches are out of synch with the database

    We are encountering a critical issue where the rollback of a session transaction rolls back any database changes, but doesn't roll back bean changes in memory. When we next access the bean, it returns information that should have been rolled back. The memory cache is out of synch with the database.
    We have a simple session bean S, using container managed transactions. We also have an entity bean E using bean managed persistence. E has a single member <name>.
    We implement a method s() in S with <trans-attribute> Required as follows:
    public void s() {
    Context lookupContext = getLookupContext();
    SHome shome = (SHome) lookupContext.lookup(SHome.NAME);
    S s = shome.findByPrimaryKey(thePrimaryKey);
    System.out.println("-- current name = " + s.getName());
    s.setName("IGNORE");
    EJBContext ejbContext = (EJBContext) getContext();
    ejbContext.setRollbackOnly();
    Since this is BMP, the setName call issues our SQL update against the S record. When the session transaction rolls back, the database changes are also rolled back. But the entity bean in memory shows the modified name. We can see this in the next call to s() since the getName() returns IGNORE rather than the original value. We have also gotten debugged into the underlying instance cache associated with the S bean descriptor. I.e.
    AbstractEJBHome ejbHome = (AbstractEJBHome) lookupContext.lookup(SHome.NAME);
    AlternateHashTable aht = ejbHome.getBeanDescriptor().getCache();
    Looking at this map of bean instances also shows that the bean instance for S is not rolled back.
    From previous conversations with the server technologies team, we understand that during the transaction, we should be working on a cloned copy of the S bean. Upon rollback, the copies should be discarded rather than merged back to the cached bean. They seem to be merged regardless of rollback state.
    We are using OC4J 10.1.3.0.0 (build 060119.1546.05277).

    Actually, what one or the developers in my group found out is two things:
    1) The clone is a shallow copy.They copy the references but not objects themselves. This has been causing problems for us.
    2) It seems that you don't work on a copy and you work on the original and they keep a copy. Now, this is fine IF you don't have multiple threads working on the same Entity bean and we moved our application from Weblogic where it throws an exception if that Entity bean is in use to OC4J which is suppose to copy the bean and doesn't so you have multiple threads possibly modifying the same object.

  • HT4759 I cannot get my calendar to sync up with the company's iCloud calendar.  The Techs all have Macs and I have Dell Dimension M4600 PC.  Can I talk to someone who can help me sync up with the company calendar.

    I cannot sync up with the company iCloud Calendar.  For some reason it does not work.  I use IE-8 and my PC is a pretty good one, Dell Precision M4600.  Any suggestions.  Thanks. 

    You would have to be using Outlook 2007 or 2010, and be signed into the iCloud account that your company is using in order to do that.  This explains how to set this up on your PC: http://www.apple.com/icloud/setup/pc.html.
    Alternatively, someone could share the calendar with you as explained here: http://help.apple.com/icloud/#mm6b1a9479.

  • The computer my ipod touch was synced to crashed and i had to get a new hard drive. When I tried to sync it with the new hard drive, it said that is was registered with a different apple id and i would have to erase everything to sync it. help!!!!!!!!!!!!

    how do i sync it with the compter without deleting all data?

    The first thing you can do is transfer your iTunes purchases from your iPod Touch to your PC.  To do this, choose File -> Transfer Purchases in iTunes.  You should authorize your new PC before doing this by clicking the Store drop down menu and selecting Authorize this Computer. Then enter in your Apple ID/iTunes Store account credentials.
    For all other content that was not purchased from the iTunes store, see this older post from another forum member Zevoneer covering the different software available to assist you with this task.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    Finally, right->click on your iPod Touch under the Devices section in iTunes, and choose Backup.  Then after erasing and syncing your iPod, restore from that back up.  Or better yet, copy a backup from your old PC to your new one if at all possible. Here is more information on backing up and restoring your iPod .  Doing so will restore all of your App data.
    http://support.apple.com/kb/ht1414
    B-rock

  • Looks like we are running out of the maximum connections IAS 6.0 SP4 can open with the database. Where is the setting and how can we change it?

    We are using IAS 6 SP4. We have 4 kjs engines and we see total 112 jre threads being spawned to database. The code is not able to open connection with the database when we go beyond 60 users (approx)
    Any clues?
    Thanks in advnace
    Sangeeta

    Hi,
    Fine,Its always better to increase the Max pool Size settings to a large value corresponding to KJS's max thread value. Sometimes i had faced problems with Asynchronous database queries eventhough i increased the Max thread value of the Driver to a good maximum value.
    If an application has a very large number of users who access the same data, then Setting the Database Cache's Maximum Connections to a large value will surely help.
    I think its always better to have a clear database connection settings strategy ,considering your Complexity of your Application 'We are using IAS 6 SP4. We have 4 kjs engines and we see total 112 jre threads being spawned to database'.
    Regards,
    T.Raghulan.

  • Have thunderbolt and need to sync ical with google calendar in order to use.  Any suggestions?

    Have a thunderbolt and MacBook.  Need to sync ical with google calendar as thunderbolt supports google calendar.  Any suggestions?

    I think we may be talking about two different things. Thunderbolt is the new two way display port on Mac Book Pros and Apple displays.
    Thunderbolt (originally codenamed Light Peak) is an interface for connecting peripheral devices to a computer via an expansion bus. Thunderbolt was developed by Intel and brought to market with technical collaboration from Apple Inc. It was introduced commercially on Apple's updated MacBook Pro lineup on February 24, 2011.
    Thunderbolt combines PCI Express and DisplayPort into a serial data interface. A single Thunderbolt port supports hubs as well as a daisy chain of up to seven Thunderbolt devices; up to two of these devices may be high-resolution displays using DisplayPort. You can move data to and from peripherals up to 20 times faster than with USB 2.0 and up to 12 times faster than with FireWire 800.
    http://en.wikipedia.org/wiki/Thunderbolt_%28interface%29
    http://www.apple.com/thunderbolt/

Maybe you are looking for

  • Linking between two IFRAME tags on the same JSP page

    I have a JSP (lets call it �PAGE_A.jsp�) that contains a table� the <TD> tags hold IFRAME tags with an initial �src� referencing a �blank.jsp�� � <!-- Report View Table--> <table width="100%"> <tr> <td> <iframe id='report_view' name="report_view" wid

  • Icloud account cannot be registrated in outlook 2010

    Hello, I want to put my icloud account in Outlook 2010 wenn he ist searching he can't find the settings. wenn I do it manually, imap, mail.me.com smtp.me.com +emailadress and passwort next messages are coming An Posteingangsserver anmelden (IMAP): Ti

  • My backup is missing from the list?

    We use our Time Capsule for multiple Macs.  Recently my laptop started acting up, (which turned out to be a hard drive problem), but when I logged into the Time Machine to restore the backup to another Mac I don't see my laptop in the list of Backups

  • Responsable agents: What's better? Role or expression (variable)

    Friends, I'm thinking about make things in the better way to improve the system performance. I have a dialog task that are sent to reponsables by a variable or expression configured in the own task. This variable is filled in a background task before

  • Terrible image quality when using Save for Web in Adobe Illustrator CS6

    When saving images of any format and of any ppi using "Save for Web", "round" corners become blurred and pixel , "acute" (vertical and horizontal) angles are clear and of good quality. Reinstalled system with the hope that the cure (Windows 7 64-bit)