Synchronize a Map
I try to synchronize the entries into a SortedMap, but it doesn't work. I use time in millisecond as key and an Integer as value. The put-Method is in a synchronized block but sometimes the key is overridden because time was to short or something like that.
How can I make sure not to override anything? How can I get different times?
I know it sounds strange, actually it is strange but i don't know how to explain better.
I need a synchronizable collection.
Thanks for help!
Here is my code
public synchronized void myMethod(int i) {
Calendar cal = Calendar.getInstance();
try {
if (i % 2 == 0) {
long time = cal.getTime().getTime();
map.put(new Long(time), new Integer(i));
} else {
long time = cal.getTime().getTime();
map.put(new Long(time), new Integer(i));
} catch (Exception e) {
System.out.println(e.toString());
System.out.println("myMethod i " + i + " map " + map);
I also tried containsKey() - didn't work.
Similar Messages
-
Try NineSYNC, Internet Data Synchronization & Mapping Web Service Software
Those who are learning or pros in web service technology, try the software named NineSYNC, an internet data synchronization and mapping web service, which really running at http://www.ninestep.com/services/ninesync/NineSYNC. You can go to the Jence Incorporated (NineSTEP) web site http://www.jence.com or http://www.ninesync.com and load the NineSYNC client. You can also load the trial version of the web service software.
NineSYNC is a real web service and its big. And it does what its supposed to do. I have tried synchronizing data from Mysql to Sql Server and it was so quick with NineSYNC. I also synchronize files with NineSYNC on a daily basis. All you have to do is set the software up and it will synchronize periodically.
Nice cool way to do things and the future of web services technology.
Burd.Burd, It's a nice program. I haven't found anything like this before and it works quite good. Thanks for sharing the informaiton. I would suggest anybody to take a look at this SW who are involved in data synchronization and mapping process.
-
Imported mapping in template mapping module still runs against old location
Hello,
I imported the mapping in a new workspace (located in other server) using object names strategy, and I reconfigured the location source (it's a generic one) it uses.
Looking at the mapping Configure menu / Table operators / Location I see the correct location I want to use.
The template mapping module has the only data location Default Agent.
I have synchronized several times with the inbound repository table information, and redeploy the mapping, but it still goes to the old location, that has been unregistered / deleted in the current repository.
I don't know how to make the mapping runs against the location I want to. Please, help me
Thank youHi Alexander
After copying a table to a different module, edit the module to set the data location, configure the module to define the location and synchronize the mapping to use this table.
In OMB to synchronize inbound and outbound use OMBSYNCHRONIZE command
Inbound:
OMBSYNCHRONIZE TABLE '$OMB_CURRENT_PROJECT/SALES/TABY' TO MAPPING 'M_W_PARAMS' OPERATOR 'TABY' USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_NAME')
Outbound:
OMBSYNCHRONIZE MAPPING 'M_W_PARAMS' OPERATOR 'TABX' TO TABLE '$OMB_CURRENT_PROJECT/SALES/TABX' USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_NAME')
Cheers
David -
Change the DB_LOCATION of a Table in Mapping after Copying it
Hello!
Does anybody know how to change the property DB_LOCATION for table in a mapping after copying it to another modul withhin the same project with OMB PLUS.
After copying the mapping all objects still points to the old objects in the repository. But this objects are now in the wrong module. I have the same repository objects also in the new module and i want to change the mapping operator to point to the objects in the new module.
In the mapping editor you achieve this by reconciling the mapping object with the new object in the other module. How can i do this with OMB PLUS?
Thanks in advance
Alexander
Edited by: user13336549 on 14.09.2010 07:40Hi Alexander
After copying a table to a different module, edit the module to set the data location, configure the module to define the location and synchronize the mapping to use this table.
In OMB to synchronize inbound and outbound use OMBSYNCHRONIZE command
Inbound:
OMBSYNCHRONIZE TABLE '$OMB_CURRENT_PROJECT/SALES/TABY' TO MAPPING 'M_W_PARAMS' OPERATOR 'TABY' USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_NAME')
Outbound:
OMBSYNCHRONIZE MAPPING 'M_W_PARAMS' OPERATOR 'TABX' TO TABLE '$OMB_CURRENT_PROJECT/SALES/TABX' USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_NAME')
Cheers
David -
How to Save & Transfer Route/Favorites from Maps ...
First of all I think that there is a lot confusing with the names of the things in OVI:
1) OviSuite is a program to synchronizing some things and download Maps.
2) Ovi Maps is a program that runs in the 5230 to do navigation and synchronization of maps
3) MapsOvi is a site in the Internet, to create and synchronize favorites and Routes.
I make a little basic test with the Maps for OVI Site and my 5230 and after creating some favorites places and routes in the Internet Site, I can not find a button to save and make the transfer of routes and favorites from the Map Ovi suite to my phone, using Bluetooth or USB cable.
There is a way to make the transfer directly from my PC to the 5230, using a USB cable or Bluetooth? Or the only way to transfer the favorites and routes created on the Maps Ovi to the phone is the real time synchronization of both, using the Internet connection on the way of my phone and spending a lot of $$$ to do this?
I think that the overall design of OVI things must be totally remade
Solved!
Go to Solution.Thank You for your help. But the problem with my Nokia 5230 is that it does not have WiFi,so I would need to use the 3G connection, wasting some Megabytes. I do not understand why the OVI software does not have an option to download the favorites and routes created in the Internet Site, directly on my phone using the USB cable or Bluetooth connection. The OviSuite could do this with the Maps,why not with the wpts and routes? Regrads. Pascal
-
Nokia C7 Synchronization of appointments from Outl...
Hi everybody,
During the setting of an Appointment in MS Outlook we usually attach a jpg map-picture showing the meeting's venue. This useful when we are on the move.
After OVI synchronization the map-picture's name is transferred as a string to appear as a "Description" and the picture itself is not transmitted in my Nokia C7. The string is by itself unusable as I want to see the map for guidance.
Was my synchronization correct? Is there a way of getting this picture in my Nokia Calendar, somewhere easy to use?
Thanks for any help.
BernardHello,
Unfortunately
Ovi Suite does not support attachment synchronization.
As a
workaround solution you could write the address into the location field of
Outlook calendar. With compatible Nokia Maps phones like for example C7, you can
pick it up by opening the meeting and selecting Options – Find on map
and get driving instructions to the meeting place.
In addition for
non Nokia phones you can insert a map link from Ovi Maps web UI http://maps.ovi.com/ First search for the address in the web UI and
then choose Share to get a link like http://ovi.me/z8g8
. Attach that link to your calendar invitation and when opening that link with a non Nokia
phone browser or PC, user can see the location of meeting place on the Ovi Maps web
UI. -
Do I need to declare a transaction in this case?
I am struggling to understand when it is necessary to declare my own transaction to ensure the data is properly updated.
For example, in the following code, which is part of a java bean in the EJB project, KeyFacade is a stateless session bean tied to the entity "Key". it is a standard EJB created with the netBeans 5.5 wizard. I have changed no defaults.
Do I need to declare a transaction, commit the transaction and close it when I use the "KeyFacade.edit(key);" in order to ensure the database is updated? Or is it automatically done because the .edit() method uses the entityManager and the persistence is container managed?
Would it make a difference if this bean was part of a WAR project?
public BigInteger getNextKey(String tableName){
KeyFacadeLocal KeyFacade = this.lookupKeyFacade();
Key key = KeyFacade.findByTablename(tableName);
long nextKey = key.getKeyvalue();
BigInteger BINextKey =BigInteger.valueOf((int)nextKey);
// now update the table by incrementing the key value by 1
long incrementKey = nextKey + 1;
key.setKeyvalue(incrementKey);
KeyFacade.edit(key);
return BINextKey;
}808239 wrote:
I have a Map<Integer, List<T>> data, and all the lists are initialized using Collections.synchronizedList().Seems like overkill to me. Your Map also looks like a Multimap, of which there are several existing implementations.
When I do the traversal, I want to traverse ALL lists in the map at the same timeI suspect not. What you want to do is to traverse each one in sequence.
so I have to sync all lists as shown in the API doc as follows: ...Seems like overkill to me, and will probably result in a very slow Map (not that there's any problem with that if it's the right thing to do; in this case, I suspect it isn't).
Is this approach ok?What are you trying to achieve? If you need full consistency for your iterators (ie, a snapshot of the entire Map at the time the iterator is created), you have a two choices (assuming you don't want to deal with update journals):
1. Lock the Map.
2. Clone the Map (and your clone() method should be synchronized).
Of the two, the second seems best to me, but neither is all that wonderful.
However, if all you need is weak consistency - that is to say, what you return reflects the state of the Map when Iterator.next() is called - all you really need to do is make sure that your Lists are synchronized when you do the read.
Since the List updates are the responsibility of your Map (I'm still presuming this is some sort of Multimap implementation), there's no real need to synchronize them; just synchronize the Map's own update methods.
I'd also suggest that you make sure your getValue() method hands back an [url http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#unmodifiableList%28java.util.List%29]unmodifiable List to clients; otherwise they could start adding or removing values themselves.
HIH
Winston -
ConcurrentHashMap VS. HashTable
Hi all,
I need to use a thread-safe map and am not sure if I can safely use java.util.concurrent.ConcurrentHashMap instead of HashTable w/o external synchronization. The Java docs says:
"A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updates. This class obeys the same functional specification as Hashtable, and includes versions of methods corresponding to each method of Hashtable.
*+However, even though all operations are thread-safe, retrieval operations do+ +not+ +entail locking, and there is+ +not+ +any support for locking the entire table in a way that prevents all access. This class is fully interoperable with+ **+Hashtable+** +in programs that rely on its thread safety but not on its synchronization details.+*
*+Retrieval operations (including+ **+get+**+) generally do not block, so may overlap with update operations (including+ **+put+** +and+ **+remove+**+). Retrievals reflect the results of the most recently+ +completed+ +update operations holding upon their onset. For aggregate operations such as+ **+putAll+** +and+ **+clear+**+, concurrent retrievals may reflect insertion or removal of only some entries. Similarly, Iterators and Enumerations return elements reflecting the state of the hash table at some point at or since the creation of the iterator/enumeration+*.
They do +not+ throw [ConcurrentModificationException|http://java.sun.com/javase/6/docs/api/java/util/ConcurrentModificationExceptio
*+However, iterators are designed to be used by only one thread at a time.+*"
I do use iterators on my map; and it will be used by many threads at the same time; so does that mean I need to externally "synchronize" my map?
The parts in bold and italic made me not sure about using the ConcurrentHashMap...JavaFunda wrote:
So can anybody give a example where we hashtable can not be replace by ConcusrrentHashMapPersonally, other than Peter's first suggestion, I can't think of a single one. I believe that EJP's post (other than line 3) was aimed at why you might prefer a HashMap ( not Hashtable) over CHM; and he's dead right.
Winston -
Method.invoke() thread save ?
Hi to you all,
Is the method invoke on the Object Method in the java.lang.reflect package threadsafe ?
Greetz-tboneI'have created a with a college a ReflectionMap where getter and setter maps to the javabean properties
using reflection at creation time the map cache the methods of the underlaying object
now we want to use it i a multiple thread context
where more than one thread can access the map a time
if the implementation of Method is threadsafe then we do not need synchronisation else
we must synchronize our map.
and sinds that synchronisation is a performence bottleneck i would like to live it out.
Tbone -
I need to rename some keys in an Hashtable, and i'm wondering if there are "better" ways than creating a new Hashtable and copying the values into it with different key names.
About using HashMap instead of Hashtable i'm not sure
i can do so, because i'm just modifying a part of a
huge web app and i'd need to make sure the change
doesn't affect other parts. Don't mess with it if you don't have to. I assumed (incorrectly) that this was a new program.
By the way what's the
advantage of HashMap over Hashtable ?HashMap isn't synchronized, and has some additional performance benefits over Hashtable. That doesn't mean that Hashtable is used when you need to synchronize the Map. The Collections class provides a method for that. The main reason is that Hashtable was replaced with HashMap. A new hashtable implementation was not created for no reason. There were problems with the original design. HashMap is a living class and will be updated and improved upon as needed. We can't say the same for Hashtable. The main reason Hashtable is still around is that it is used in too much code in the JDK and elsewhere. A lot of developers still use it and I think that's a huge mistake. -
Removing Products in B1 Doesn't Remove Them in WebTools
I'm kind of confused about how WebTools is synching with Business One. I deleted a 14 items in B1 and then ran a successful sync, which showed those 14 records as coming in with a Delete request. What I don't understand is that those items are not then deleted from WebTools anywhere. They still exist in the PartsMaster table and show up on my website, and if they were a part of any variants, they are still listed as valid options. Is that how it is supposed to work? Doesn't that defeat the purpose of the sync?
DerekHi Derek,
Here is the SAP note:
Synchonization Limitations for SAP B1 Web tools 2007
Symptom
List of known Synchonization Limitations for SAP Business One Web tools 2007
Other terms
E-Commerce, NetPoint, Praxis
Reason and Prerequisites
Solution
No Scalability available
In current version it is not possible to distribute the load of SAP BusinessOne Web tools to more then one server. -This functionality will be provided with next version SAP Business One Web tools 2008
Changing Address Names
Changing Address Names in SAP Business One Web tools will cause synchronization problems -This has to do with multiple bill-to addresses for non-vendors not being supported in B1. Address labels should stay constant for consistency.
SAP Business One Web Objects Deletes and Cancels are not supported
SAP Business One Web never deletes anything in B1. To delete, you must perform the delete in B1 and SAP Business One Web tools each individually.
Upgrades will overwrite customization changes to web page files or controls.
If you hand edited any of the existing pages in web directory (.aspx or .ascx extensions) these files will be replaced with the newer files from the install or uprade package and your changes will no longer be active and will need to be reintroduced into the files again if you still feel they are necessary.
Audit Trails or Archiving
Currently no archiving is possible and no Audit Trails are kept.
No Synchronization of SAP Business One Web tools only items
No Synchronization of SAP Business One Web tools only items: Variants, Prospects, Campaigns, Machines & Fitments, Support Projects, Part Attributes, Cross Sell, Additional Media, Additional Notes, Product/Style Lines, Shipping Price Charges/Breaks, Payment Price Charges/Break. -Workaround: can be handled with a custom plug-in. For more information, please download our SDK which contains an API and a synch plug-in tester.
One-Way synchronization from SAP Business One to SAP Business One Web tools
One-Way synchronization from SAP Business One to SAP Business One Web tools: Price Lists, Invoices, A/R Transactions, Deliveries, Inventory -Changes made in SAP Business One to these items will be either overwritten in SAP Business One Web tools or misrepresented in B1.
User Defined Fields do not synchronize.
User Defined Fields in SAP Business One Web tools do not synchronize. Workaround: can be handled with a custom plug-in. -For more information, please download our SDK which contains an API and a synch plug-in tester.
Vendors and Leads do not synchronize from SAP Business One Web tools
Vendors and Leads do not synchronize from SAP Business One Web tools -SAP Business One Web tools synchronizes standard Business Partners only
Template and Production Bill of Materials are not supported
Template and Production Bill of Materials in SAP Business One Web tools are not supported -The only types of BOM's which SAP Business One Web tools supports are Sales and Assembly
Additional Expenses are not fully supported
SAP Business One Web tools Additional Expenses are not fully supported -SAP Business One Web tools utilizes shipping and handling document expenses, this cannot be broken down on a part by part basis. There are only two expenses available to assign. Shipping or handling.
No Synchronization of Mapped Items: Taxes & Codes
Tax laws are often different for e-commerce than for standard commerce. SAP Business One Web tools allow for more flexible tax application.
Restrictions to Pricelist
Restrictions to Pricelist: No support of Hierarchies, Expansions, Pricelist Discount Groups, and Pricelist Account Special Pricing Discount Percentage -SAP Business One Web tools only synchs Pricelists and Account pricing. Quantity Discounts, Hierarchies, Expansions, Pricelist Discount Groups, and Pricelist Account Special Pricing Discount Percentage are not supported.
Account ID should be restricted to 16 characters for B1 synchonization
To synchronize a SAP Business One Web tools account to SAP Business One Web, the account ID should be restricted to 16 characters as otherwise the synchronization will fail.-Whencreating prospect names or new business partners in SAP Business One Web tools, limit the Account ID to 16 characters or less.
Taxes need to be Setup seperately with SAP Business One Web tools
Appropiate retail internet taxes for your localization will need to be created. When these tax codes are created you will need to make sure to use proper and valid start and expiration dates for interent taxes to be calculated correctly for retail customers that are newly created.
Payment Methods need to be created seperately inside SAP Business One Web tools
You will need to add applicability date details for Payment Methods that are in your expenses. These expenses must be created with proper and valid start and expiration dates.
Discount Codes must be setup in SAP Business One Web tools
If discount codes (coupons) are appropiate for your business you will need to set them up in SAP Business One Web tools. These codes can be repeated because of multiple or changing applicability dates. These dates must be entered in an appropiate and valid fashion for the discount to apply. This discount will appear on the SAP Business One document as a discount as well.
Service contracts of type serial number synchronize only from B1 to Web tools
There is no support of serial numbers for items within Web tools, therefore, service contracts of type serial number will synchronize to Web tools, but changes made in Web tools will not synchronize back to B1.
SAP Note Number Display Print
Note Language
Version
Related Notes
1009949 Central Note for SAP Business One Web tools 2007
994090 Release Updates on SAP Business One Web tools 2007
Additional Information
RELEASE STATUS: Released for Customer
Released on: 27.03.2007
Priority: Recommendations/additional info
Category: Release planning information
Primary Component: SBO-WEB-B1 B1 Synchronization - SAP Business One Synch Manager -
Creating user accounts with OIDDAS and use them from the OS
Hi,
I have a customer that is experiencing an error creating user accounts from OIDDAS, and use that user accounts from the operating system.
My customer is using OID/OAS4OS 10.1.4.2.0, and that version is not longer available to download, then, I will try in my own environment
with OID/OAS4OS 10.1.4.3.0.
And the question is the following: is supported to create user accounts with OIDDAS and expect that users can work with OAS4OS and be
able to authenticate in the operating system?
For the reference, SR# 7222351.993:
Thanks,
Luis Vivero.
Edited by: LV in ORCL on Dec 11, 2008 6:47 AMHi Jacco,
I didn't see your post before.
Nop, unfortulately I don't have a document with that. I just received that answer
from development (related to the plugin for AD that is not certified, and DAS is
not intended to work with OAS4OS).
Anyway, about the plugin to work with AD, this is working for me; at least I tested
it by configuring the plugin, I configured synchronization, the mapping file, I did
the bootstrap, and the accounts that were bootstraped now shows the OS attributes
on DAS.
Regards,
Luis Vivero. -
BB Desktop 4.5, WinXP, 8330 Blackberry - install issue
Hi, tired to install BB Desktop Manager 4.5 on a laptop w Win XP pro - need for user w/o administrator privleges. Got software installed thru administrator acct, but now cannot set up sychronization to the limited user account. I tried setting up sync thru administrator account, but it wants to use administrator account outlook/contacts, not user's outlook/contacts/etc. When I attempt to setup thru user account, I cannot get to setup for sychronize (to map to Outlook).
Any ideas on how to make this function?
Thanks
Solved!
Go to Solution.Hello petrodave,
Welcome to the BlackBerry Support Community Forums
When you say "I cannot get to setup for synchronize (to map to Outlook)." do you mean that Outlook is not an option under that list of translators? Are you getting errors?
The more detail you can provide the easier it will be for us to assist you.
-FB
Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
Be sure to click Kudos! for those who have helped you.
Click "Accept as a Solution" for posts that have solved your issue(s)! -
Using EPMA to transfer data between HFM and Essbase on 11.1.1.3
Can we use EPMA to transfer data between HFM application and Essbase cubes on Hyperion version 11.1.1.3?
As far my understanding we can only link HFM and Essbase through EAL.
I would be very keen to know from the audience if we can use EPMA to transfer data between HFM and Essbase
Hyperion version 11.1.1.3
Windows 2003 64-bit
Regards
Yogananda BharadwajHi Yogananda,
Check epma admin.pdf, page 439. Chapter 19 describes how to synchronize and map data between Hyperion applications, interface tables, and external files via EPMA Data Synchronization.
Regards,
Thanos -
SharePoint 2013: Update User Profile Properties is giving error
Hello all SharePoint Gurus - I am trying to update the User Profile Properties. The update I am trying is to
Property Mapping for Synchronization. Mapping mobile property of AD to the User Profile Property Mobile Phone.
It is giving error "An Error occurred when updating a property". Check ULS is not showing any error.
The FIM Service, USer Profile Services and Synchronization Services all are in Started mode. Properly synchronizing with AD.
Please throw some light on this.
Regards,
KhushiHi Khushi,
According to your description, my understanding is that you got an error when you make "Mobile Phone" map to "mobile" from AD properties.
I did a test as your description, in my testing, everything worked well.
Please try to stop User Profile Synchronization service and User profile service, then restart them, compare the result.
There are some similar posts about this issue, pease check if they are useful for you:
https://social.technet.microsoft.com/Forums/sharepoint/en-US/32937e1d-830e-4553-bdfc-23d3ee7f6d07/why-mapping-of-user-profile-property-fails
http://sharepoint.stackexchange.com/questions/34634/mapping-user-properties-fails
If this issue still exists, please check Windows Event Viewer to check there is something about this issue:
How to use Windows Event Viewer:
http://blog.credera.com/technology-insights/microsoft-solutions/troubleshooting-sharepoint-errors/
Best Regards,
Wendy
Wendy Li
TechNet Community Support
Maybe you are looking for
-
How do I Move iTunes to a new PC?
This relates to the thread at http://discussions.apple.com/thread.jspa?threadID=895833. I posted there, didn't receive a reply, and thought others might be able to help. It would probably help if you scanned the first two postings to the thread... I
-
Strange behavior when I try to match a mpeg2 video with the menu size image
hello all, got a strange behavior when I try to match a mpeg2 video with the menu size image, menu size is 1920 x 1080 (photoshop file) mpeg2 video 1920 x 1080 (1second 19 frames) the idea is to go from the menu link to the next sub menu with a video
-
Looking at buying a Macbook- what do I do instead of Appleworks?
Hi, I use Appleworks and it works fine for me. I am looking at getting a Macbook and will need a wordprocessor, but MS is out of my budget now? Any suggestions? How does Pages compare with Appleworks? Thank you
-
Question regarding to changing the region of the app with remaining balance
Question regarding to changing the region of the app with remaining balance Hello, I am attempting to change the location of my app store which has remaining balance of 0.01$. In order to change the location of the store, it requires spending all t
-
Set Document library view as welcome page
Hi I want to set my Document library view as welcome page of my SharePoint site 2013. How can I achieve this. Regards, Siva.