Updating a HashMap Concurrently

Hi
I am using a thread with a LinkedBlockingQueue to read updates from a service and push the data into a LinkedBlockingQueue.
For each of these update I want to retreive the corresponding record from a HashMap make some calculations on that record and write it back into the HashMap using ExecutorService execSvc = Executors.newCachedThreadPool();.
Obviously if I get for example two updates for the same object these updates will be read in order into the LinkedBlockingQueue. However the thread which takes these recors from the LinkedBlockingQueue will attempt to put them into the hasMap using the ExecutorService execSvc = Executors.newCachedThreadPool(); thread pool. The order in which it writes the records is not guaranteed correct? If this is the case I may get invalid data in my hashmap.
How can I write the records in the order in which they were received to the hashmap?
Thanking you in advance...

I guess.... didn't understand.
But, use Hashtable isn't an option?From what I understand, you have one queue, and you use several threads that each take a single object from the queue, and stick it in the map. Is that right?

Similar Messages

  • Openquery update and optimistic concurrency

    Hi, I need to update a mySQL database through a linked server in SQL.
    I can successfully add, delete, but struggle to update a row twice.
    exec ('UPDATE OPENQUERY (SIBC, SELECT UID, value1, value2 FROM table1 WHERE UID= "SCEP"'')
    SET value1= "hello" WHERE UID= "SCEP"')
    The first time I run the update, it succeeds, but thereafter I get the following error message :
    OLE DB provider 'MSDASQL' could not UPDATE table '[MSDASQL]'. The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized. [OLE/DB provider returned message: Row cannot be located for updating. Some values may have been changed since it was last read.] OLE DB error trace [OLE/DB Provider 'MSDASQL' IRowsetChange::SetData returned 0x80040e38:  The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.].
    Any ideas ?
    Thanks.

    Hi Conor, thanks for your reply.
    The only process updating the system is my application as it's on the development environment.
    I have an unusual issue in that I can update a datetime field in mySQL only once I've provided it a value explicitly through a mySQL query analyser utility.
    The other odd problem I have is that when I perform the update, it has to actually update a field otherwise it fails, thus if I try update a column TEMP1 with a value of 1, but it already contains a value of 1, it fails.
    PS: the provider is a mySQL provider, which doesn't allow 4 part naming in SQL.
    I've a feeling the issue could exist with the ODBC driver, but unfortunitely the mySQL and Microsoft communities do not seem to work together too nicely.
    Thanks for your help.
    Karlo

  • How to updated log into Concurrent Request

    Hi All,
    I am using FND_REQUEST.SUBMIT_REQUEST in Stored PL/SQL Procedure to fire Concurrent Request to Import records thru Interface.
    The concurrent request is run successfully and import records also successfully.
    Now incase, if any error occured, I want to update the log file at concurrent request level and can see the log using "View Log" in Concurrent Request Window.
    Can anyone guide me how it is possible ?
    regards & thanks in advance....
    Sanjay Desai

    Hi Srini,
    Thanks for reply.
    We have EBS Ver: 11.5.10.2 .
    We are using seeded concurrent program (WIP Mass Load) to import data .
    To import data, we are using following command line in PL/SQL Stored procedure.
         V_CONC_REQ_ID := FND_REQUEST.SUBMIT_REQUEST( 'WIP' ,'WICMLP','WIP Mass Load', SYSDATE, FALSE, 1, 0, 2 );
    The data is imported successfully but we have found that the LOG file is updated with seeded codes and messages
    ( view LOG Navigation path : MENU > VIEW > REQUESTS > FIND REQUEST BUTTON > VIEW LOG )
    but I want to update the LOG file with custom messages instead so that we can debug easily, incase of error occurred.
    We have tried to update the LOG file with custom message using command : FND_FILE.PUT_LINE ( FND_FILE.LOG , < msg > ), but LOG file is not updated.
    I hope you understand my problem. Can you guide me in the issue ?
    regards
    Sanjay

  • MSI Live Update 5 & 6 concurrently installed, which to keep?

    I have MSI Z87 MPOWER MAX Intel Z87 Motherboard, and am using Windows 8.1
    Somehow, I ended up with two separate Live Updates.
    1.  Which one should I be using? (Presuming 6)
    2.  Any information on how to uninstall the unwanted version?

    Hi,
    1) I suggest removing BOTH and simply use product site for driver updates. Safer and more accurate
    2) Simply use Programs&Features to uninstall unwanted version

  • Same update in concurrent transactions

    same update statement in concurrent transactions, update 10 records
    update test set id=id where rownum<10
    first transaction update 1,2,3,4,5,6,7,8,9,10
    second transaction update 10,9,8,7,6,5,4,3,2,1
    This may lead to deadlock?
    That will not happen under normal circumstances
    but row migration

    872390 wrote:
    same update statement in concurrent transactions, update 10 records
    update test set id=id where rownum<10
    first transaction update 1,2,3,4,5,6,7,8,9,10
    second transaction update 10,9,8,7,6,5,4,3,2,1
    This may lead to deadlock?
    That will not happen under normal circumstances
    but row migrationrefer the link:-http://www.orafaq.com/node/854

  • Concurrently update awt components

    Hello all,
    What I understand is that it's impossible to update awt components concurrently in a thread save way. For example; If you want to implement a game in which when you push on a button a counter starts to run (in a JTextField for example). While that counter is running you want that button to be disabled for a fixed time, let's say 1 second, and want to count down on that button's text. At the same time other components should be updated by other code in the game logic ( things like mana regenration counters etc.).
    Is this possible in a thread save way with standard libraries?

    Thank you for replying.
    Yes that is what I understood. My problem is though, for example in the case of the mana regeneration, that I want it to regenerate at a fixed rate. So x amount in y seconds. I know this comes close to real time programming and is not really possible, but that's not the point here. What I'd like is that the current mana is available to the game logic and displayed at the same time in the gui, while it's being updated. While this mana regeneration is running, the user can press another button (a spell) and the mana takes another hit, while still being updated by the regeneration thread. Other game logic may affect the mana aswell (like abilities of monsters).
    The problem here is that I need none user events to update awt components and that it should be displayed in the gui real time (ish).

  • How to find the request id for these suspect dead concurrent request

    Dear All,
    Good afternoon.
    Below are the CMCICU (Updated Standard Cost) concurrent request which we can not find in the front-end of Oralce EBS.
    We want to verify the concurrent request id for these.
    How can we do it?
    myermt01@oracle:/home/oracle> ps -ef|grep CMCICU
    oracle 24533 22566 1 15:17:00 pts/2 0:00 grep CMCICU
    oracle 29625 2028 3 Aug 22 ? 27:20 CMCICU APPS/7484718500033DFF77FFB8BC77FFB9B077FFBAA477FFBB98401
    oracle 15881 8762 4 Aug 23 ? 27:36 CMCICU APPS/7484718700033DFF00000000000000040000000000000000400
    oracle 4913 6136 7 Aug 23 ? 28:03 CMCICU APPS/7484718800033DFF00000000000000040000000000000000400
    oracle 7913 23291 5 Aug 22 ? 27:50 CMCICU APPS/7484718500033DFF77FFB8BC77FFB9B077FFBAA477FFBB98401
    oracle 3813 23290 5 Aug 23 ? 27:47 CMCICU APPS/7484718800033DFF00000000000000040000000000000000402
    oracle 5858 23115 7 Aug 22 ? 27:58 CMCICU APPS/7484718500033DFF77FFB8BC77FFB9B077FFBAA477FFBB98401
    oracle 2166 19728 5 Aug 22 ? 27:15 CMCICU APPS/7484718500033DFF00000000000000040000000000000000400
    oracle 2165 24039 3 Aug 22 ? 27:31 CMCICU APPS/7484718500033DFF77FFB8BC77FFB9B077FFBAA477FFBB98401
    oracle 26105 22429 4 Aug 23 ? 27:23 CMCICU APPS/7484718500033DFF00000000000000040000000000000000401
    oracle 8703 8698 3 Aug 22 ? 27:30 CMCICU APPS/7484718500033DFF000000000000000A0000000100000000400

    Hi Henry;
    Please check below thread which could be helps you
    Concurrent program- How to find database session
    Re: Reg: Apps Concurrent
    Concurrent Request-whcih is submmited by one of the Oracle USER
    How to See Others Concurrent Request Oracle 11i
    Regard
    Helios

  • Fake update or select with (udplock) or select with (updlock, rowlock)?

    I need  to block some rows to control the concurrency. I have this table:
    Table(ID, Concurrency...)
    Concurrency is a nullable bit that is only used to do the fake update.
    I need to block the row to avoid that the row is selected by a second process one the first select it. So by the moment I am doing:
    begin tran
    Update Table set Concurrency = Concurrency where ID = 123
    --My process
    commit
    In this case, when two process execute the same code, the first one block the row with ID 123 and the second process has to wait until the first process ends.
    I am trying to use hints for this, to avoid the need of the fake update, because I guess that has worst performance than a select, so I have tried something like that:
    begin tran
    select * from Table with(rowlock, xlock) where ID = 123
    commit
    With serializable isolation level too, that is the most restrictive, but sometimes, with some conditions in the where, the row is not blocked. So that is the reason why I am using the fake update, because the update works always.
    However, I have read that I can use the hint UPDLOCK, that seems that locks the row in the select, but how it is a hint, I am not sure if this solution block always the row or sometimes doesn't do it, like the rowlock, xlock. I have tested this and it seems
    that works, but when I use an ID as condition, I don't know if it works in all cases.
    Another alternative that I have seen is with (UPDLOCK, ROWLOCK). What is the difference? Because with only UPDLOCK only locks the rows affected by the conditions in the where, so I am not sure why to use ROWLOCK too.
    What I want is to ensure that I block the row until the process has finished.
    There are any other alternative to block a row to avoid the select?
    Thank so much.

    First of all, have you looked at application locks? Maybe this is what's need rather than fake updates?
    UPDLOCK is a hint on the same parity as XLOCK. XLOCK takes out an exclusive lock, and no other process can access the row. But some the engine dodges the lock it seems.
    UPDLOCK does not prevent other process from reading the row with a regular shared lock. However, only one process at a time can have an Update lock on a row. The purpose for an UPDLOCK is to mark that you intended to update the row later.
    ROWLOCK controls the granuality, and since row lock is the default lock granularity it should not be needed in very many cases.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Concurrent program schedule details?

    Which view/table can I query to find the schedule details for a concurrent request that is set to run at a specific interval ?
    I've discovered how to set the interval using;
    fnd_request.set_repeat_optionsand now would like to view the schedule information much the same as one is able to view the schedule information for dba_scheduler .
    Is that possible?

    Hi bluefrog,
    I don't think it's possible to modify an existing request using it. You could try updating directly the concurrent request table but it's neither recommended nor supported, and you could get unexpected results.
    If you want to unschedule the request programatically, maybe you could use fnd_concurrent.cancel_request (selecting the appropriate request id, because everytime one scheduled request is executed, it creates a new one with same repeat options and new start date). If you want to schedule it again, just submit again fnd_request.set_repeat_options with selected options + fnd_request.submit_request.
    Hope it helps.

  • Concurrency violation: the UpdateCommand affected 0 records.

    If changing ename in datagrid and try to update error occurs:
    "Concurrency violation: the UpdateCommand affected 0 records."
    With OleDbDataAdapter and MSORA works well.
    Is it a Beta issues?
    Public Class FormTest
    Inherits System.Windows.Forms.Form
    Dim con As Oracle.DataAccess.Client.OraConnection
    Dim cmd As Oracle.DataAccess.Client.OraCommand
    Dim da As Oracle.DataAccess.Client.OraDataAdapter
    Dim cb As Oracle.DataAccess.Client.OraCommandBuilder
    Dim ds As DataSet
    #Region " Vom Windows Form Designer generierter Code "
    Public Sub New()
    MyBase.New()
    ' Dieser Aufruf ist f|r den Windows Form-Designer erforderlich.
    InitializeComponent()
    ' Initialisierungen nach dem Aufruf InitializeComponent() hinzuf|gen
    End Sub
    ' Die Form |berschreibt den Lvschvorgang der Basisklasse, um Komponenten zu bereinigen.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
    If Not (components Is Nothing) Then
    components.Dispose()
    End If
    End If
    MyBase.Dispose(disposing)
    End Sub
    ' F|r Windows Form-Designer erforderlich
    Private components As System.ComponentModel.IContainer
    'HINWEIS: Die folgende Prozedur ist f|r den Windows Form-Designer erforderlich
    'Sie kann mit dem Windows Form-Designer modifiziert werden.
    'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
    Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
    Friend WithEvents ButtonFill As System.Windows.Forms.Button
    Friend WithEvents ButtonUpdate As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.ButtonFill = New System.Windows.Forms.Button()
    Me.DataGrid1 = New System.Windows.Forms.DataGrid()
    Me.ButtonUpdate = New System.Windows.Forms.Button()
    CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
    Me.SuspendLayout()
    'ButtonFill
    Me.ButtonFill.Location = New System.Drawing.Point(320, 16)
    Me.ButtonFill.Name = "ButtonFill"
    Me.ButtonFill.Size = New System.Drawing.Size(112, 32)
    Me.ButtonFill.TabIndex = 0
    Me.ButtonFill.Text = "Fill"
    'DataGrid1
    Me.DataGrid1.CaptionText = "Test Datenzugriff"
    Me.DataGrid1.DataMember = ""
    Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
    Me.DataGrid1.Location = New System.Drawing.Point(8, 64)
    Me.DataGrid1.Name = "DataGrid1"
    Me.DataGrid1.Size = New System.Drawing.Size(544, 344)
    Me.DataGrid1.TabIndex = 1
    'ButtonUpdate
    Me.ButtonUpdate.Location = New System.Drawing.Point(440, 16)
    Me.ButtonUpdate.Name = "ButtonUpdate"
    Me.ButtonUpdate.Size = New System.Drawing.Size(112, 32)
    Me.ButtonUpdate.TabIndex = 2
    Me.ButtonUpdate.Text = "Update"
    'FormTest
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(560, 413)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.ButtonUpdate, Me.DataGrid1, Me.ButtonFill})
    Me.Name = "FormTest"
    Me.Text = "FormTest"
    CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
    Me.ResumeLayout(False)
    End Sub
    #End Region
    Private Sub ButtonFill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonFill.Click
    ' Connect
    Try
    con = New Oracle.DataAccess.Client.OraConnection( _
    "User Id=scott;Password=tiger;Data Source=MTV_np")
    con.Open()
    ' Create the OraCommand
    cmd = New Oracle.DataAccess.Client.OraCommand("select * from emp")
    cmd.Connection = con
    cmd.CommandType = CommandType.Text
    ' Create the OraDataAdapter
    da = New Oracle.DataAccess.Client.OraDataAdapter(cmd)
    ' Create the OraCommandBuilder
    cb = New Oracle.DataAccess.Client.OraCommandBuilder(da)
    da.InsertCommand = cb.GetInsertCommand
    da.UpdateCommand = cb.GetUpdateCommand
    da.DeleteCommand = cb.GetDeleteCommand
    ' Populate a DataSet
    ds = New DataSet()
    da.FillSchema(ds, SchemaType.Source)
    da.Fill(ds)
    Me.DataGrid1.DataSource = ds
    Me.DataGrid1.DataMember = "Table"
    Catch ee As Exception
    MessageBox.Show(ee.Message)
    End Try
    End Sub
    Private Sub ButtonUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUpdate.Click
    Try
    da.Update(ds, "Table")
    Catch ee As Exception
    MessageBox.Show(ee.Message)
    End Try
    End Sub
    End Class

    Jens,
    This is a problem with ODP.NET. This issue will be fixed in the next Beta release of ODP.NET. In the meantime, a workaround would be to NOT set the individual OraDataAdapter commands (InsertCommand, UpdateCommand, and DeleteCommand) with the SQL generated by the OraCommandBuilder. Generally speaking (in ADO.NET terms), if the command properties are not set and the OraCommandBuilder is instantiated for a data adapter, invoking .Update on the dataadapter will automatically utilize the SQL generated by the commandbuilder since the "custom SQL" is not provided by the application. Essentially, leaving the dataadapter commands to null and associating the commandbuilder to the dataadapter enables "auto-SQL generation."
    There's actually a benefit ODP.NET provides in leaving the command properties of the OraDataAdapter to null. For example, an UPDATE statement actually requires only the modified column data in the SET clause. Therefore, ODP.NET does not bind unmodified column data in the SET clause of an UPDATE SQL. (The WHERE clause will of course contain all the columns in the datatable (except for non-scalar data) to avoid dirty writes.) This approach can provide better performance if there are some large scalar data in the DataTable that are not modified. In other words, the OraDataAdapter does not use the public Get(Insert/Update/Delete)Command() methods when OraDataAdapter.Update() is called. Instead, OraDataAdapter uses an internal function which builds an optimized UPDATE SQL for that row that only binds the updated column data in the SET clause.
    If you use the public Get(Insert/Update/Delete)Command() method explicitly as in your application, the OraCommandBuilder will generate the UPDATE SQL which sets every column in the datatable since it has to be generic enough to update any row in the DataTable. Therefore, your application is NOT actually using the enhanced functionality of "auto-generated command" that ODP.NET provides. Instead, the application is using the generated SQL as a "Custom SQL".
    thanks,
    nari.

  • Concurrent requests failing due to Linux CUPS service

    Dear all,
    We have a customer running their production instance on e-business suite -11.5.10.1 with Rdbms - 10.2.0.3. It is a single-node, single-tier installation running on Redhat Linux 3 (Update-8)
    Whenever, concurrent programs are submitted with Print option, the concurrent requests keep hanging and never complete. At this time, the CUPS service uses 25% of the CPU time. If we restart the CUPS service, all requests complete with warning -
    lpr: unable to print file: server-error-service-unavailable
    APP-FND-00500: AFPPRN received a return code of failure from routine FDUPRN. An error occurred while AOL tried
    to spawn the print process
    Cause: AFPPRN received a return code of failure from the OSD routine FDUPRN. An error occurred while AOL tried to spawn the
    print process.
    The only workaround, is to run the concurrent request, without print option. But, this is not an option.
    Please suggest a fix for this CUPS issue.
    Thanks

    Check Note: 359890.1 - Apps Print Requests Fail with lp: unable to print file: client-error-not-found (Or lp: unable to print file: server-error-service-unavailable)
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=359890.1

  • Register concurrent programs parameter customization.

    Is there a way to register customization of concurrent programs parameters (I need to make one of the parameters mandatory) like it is done with customized files in applcust.txt?

    Sorry about the late reply, but the issue with applcust.txt is that it only checks files updated by the patch. To provide an update to a concurrent program definition, Oracle includes an LDT file in the patch, but the name of the file doesn't have to relate to the concurrent program being updated. For example, the Purchasing concurrent program POXACREC is defined in the following files (look for the BEGIN PROGRAM "POXACREC" "PO" line in the ldt files in $PO_TOP/patch/115/import/US), shown in their applcust.txt format:
    po patch/115/import/US cst4946920_1.ldt
    po patch/115/import/US poprg.ldt
    po patch/115/import/US poxacrec.ldt
    Based on the name of the file and the concurrent program name, you would assume the last of these is the "correct" one, but all three could provide an update to the concurrent program definition. If you have multiple files defining your customised concurrent program, I would suggest you list all three in your applcust.txt. However, even if you list all three, there is nothing stopping Oracle from updating the POXACREC concurrent program with a file called abc123.ldt.
    To help with this, I would suggest for your concurrent program you also include the concurrent program executable itself in the applcust.txt file (po reports/US POXACREC.rdf in my example) as a change to parameters in an unexpected ldt file would require a change in the program as well.
    This basic problem can occur with any of data provided by LDT files or objects where the object name is not dependent on the file name - even views can be updated by odf files or sql files.
    theFurryOne

  • Multiple calls of sendBytes+cipher.update are "very slowly"

    Hi all,
    My applet encrypts own data and returns them within the APDU response. For encryption Im using the AES 128bit CBC without padding. Because my data stored in EEPROM are too large I encrypt them in parts to APDU buffer and then send these parts by sendBytes method.
    I found very interesting thing:
    I call multiple cipher.update followed by sendBytes method in the loop until all data are encrypted and sent. My response is very very late.
    Here are single cases and time duration for them. Please dont think about these unused cases.
    They was written to simulate my problem and for time measurement.
    byte[] data = new byte[4096];//created in applet constructor
    *1.test case*
    cipher.update(data, (short) 0, (short) 1440, apdu.getBuffer(), (short) 0);
    apdu.sendBytes((short) 0, (short) 1440);
    cipher.update(data, (short) 1440, (short) 1440, apdu.getBuffer(), (short) 0);
    apdu.sendBytes((short) 0, (short) 1440);
    cipher.update(data, (short) 2880, (short) 1200, apdu.getBuffer(), (short) 0);
    apdu.sendBytes((short) 0, (short) 1200);
    cipher.update(data, (short) 4080, (short) 16, apdu.getBuffer(), (short) 0);
    apdu.sendBytes((short) 0, (short) 16);
    Time duration: 5.126s
    *2.test case*
    cipher.update(data, (short) 0, (short) 1440, apdu.getBuffer(), (short) 0);          
    cipher.update(data, (short) 1440, (short) 1440, apdu.getBuffer(), (short) 0);
    cipher.update(data, (short) 2880, (short) 1200, apdu.getBuffer(), (short) 0);          
    cipher.update(data, (short) 4080, (short) 16, apdu.getBuffer(), (short) 0);
    apdu.sendBytes((short) 0, (short) 1440);
    apdu.sendBytes((short) 0, (short) 1440);
    apdu.sendBytes((short) 0, (short) 1200);
    apdu.sendBytes((short) 0, (short) 16);
    Time duration: 1.278s
    *3.test case (just encryption)*
    cipher.update(data, (short) 0, (short) 1440, apdu.getBuffer(), (short) 0);          
    cipher.update(data, (short) 1440, (short) 1440, apdu.getBuffer(), (short) 0);
    cipher.update(data, (short) 2880, (short) 1200, apdu.getBuffer(), (short) 0);          
    cipher.update(data, (short) 4080, (short) 16, apdu.getBuffer(), (short) 0);
    Time duration: 1.132s
    *4.test case (just send dummy data from APDU buffer)*
    apdu.sendBytes((short) 0, (short) 1440);
    apdu.sendBytes((short) 0, (short) 1440);
    apdu.sendBytes((short) 0, (short) 1200);
    apdu.sendBytes((short) 0, (short) 16);
    Time duration: 0.224s
    Can somebody explain me what could rapidly reduce a speed of operation in case 1? Any ideas?
    thanks

    An observation: in the slow case, encryption can be concurrent with data transmissionWhy are these two operations concurrent? They should be synchronized or not?In the first example, but not the second, it could conceivably be that the second <tt>cipher.update</tt> is concurrent with the first <tt>apdu.sendBytes</tt> (that is: occurs simultaneously; <tt>apdu.sendBytes</tt> schedules a transfers that could occur later, while <tt>cipher.update</tt> runs). Never seen this, but that could be, especially if there is some intelligent device (e.g. NFC mobile phone) in-between the card and reader.What I know, the JCOP version I'm using doesn't support multithreading.
    What is the communication context/chain ? ISO 7816-3, T=0 or 1, f=, F/D= ? Straight ISO 14443-4, type = A or B, parameters like ATQB and ATTRIB, or analog for type A ? SWP + what ?Sorry, I'm newbie in JavaCard, so I don't know detail information about protocols I use in my case. (..)
    What I know is that T=1, (..)
    My reader is OmniKey 5321, last driver 1.2.9.2 for Win7. That reader is both contact and contactless. Which one is in use ?
    If you use contacts, the protocol could be ISO 7816-3, T=1. If you use contactless, the protocol is most likely ISO 14443-4, even though T=1 appears in the (simulated) ATR that you obtain from the (PCSC interface of) the reader.
    By "chain" I mean the various things linked between your code and the card. E.g. assuming the card is a straight contactless card (not a mobile phone) and you use Oracle's Java (1.)6 or later, most likely: card <-> OmniKey 5321 <-> it's driver <-> PCSC aka winscard <-> JVM <-> javax.smartcardio. Complications occurs with mobile phones.I use contactless mode. For connection I'm using either SSComm tool from NXP or javax.smartcardio, so your chain above is good.
    Have you looked for retries ? Waiting time extension ?Maybe you mean APDU.waitExtension(). Am i right? I've tried to call this after sendBytes but without success.I was asking if you investigated if there are communication retries by the reader, and waiting time extension requests sent by the card to the reader, which are some of the likely causes of the slowdown (the answer is clearly: you so far used no tool allowing you to check that).No, I didn't check if some retries exist. Does exist some tool for such purpose?
    If not, at least: is the timing in the slow case consistent from one experiment to the other ? When card/device is moved at a different position from the reader, if applicable ?I dont't understand the term consistent timing.Consistent = repeatable from one experiment to another, including moving the card at a slightly different position/height from the reader (assumed contactless). If the timing was very variable, that would suggest random errors and a retry mechanism.The time are very similar also for different height from the reader. Differences are cca +-10%.
    thanks

  • Converting text String to XML file data

    need some guidance. I have to create a XML file of a huge Text File.
    I am parsing the text file according to relevance and passing a set of data each element and attribute seperated by "_".
    I need to create to Xml file out this. It has to be current process as I need to keep on adding new elements and attributes.
    e.g.
    Passing this string
    String temp("Name_Age_Birthdate_Birthplace_Place_teleNumber");
    Need to add this to XML of format
    <Directory>
    <Person>
    <Name>
    <Age>
    <Birthdate>.....
    </Person>
    <Person>
    </Person>
    </Directory>
    The problem not all attributes may be present at some time..
    e.g.
    the person's age may be absent some times.. during that time the xml file should look like <Age/>
    I will need to keep on updating Person list concurrently after the file has been created..
    Need Urgent guidance.. I am still New to java
    A guidance code or link is awaited..
    Thanks.. a Lot

    Do you need to stick to the XML support that comes with Java 1.4 or can you use Third-Party stuff? I'm asking, 'cause I think JDOM is much easier to use for a newbie than the build-in XML API ... and it comes with a VERY easy to use class XMLOutputter that creates XML files!
    Take a look at JDOM:
    http://www.jdom.org/

  • Synchronizing many reader threads with one writer thread?

    Hi
    I was wondering if there is a way in java to allow different threads to read an object simultaneously however to block them all only when the object is being updated. Here is an example:
    I have the following object which is shared between many Servlet instances:
    public class ActiveFlights
         private final HashMap<String,Flight> flights;
         private final Object lock;
         public ActiveFlights()
              flights = new HashMap<String, Flight>();
              lock = new Object();
         public void updateFlights(ArrayList<FlightData> newFlights)
              synchronized (lock)
                   //some code which updates the HashMap
         public ArrayList<Flight> getSomeFlights()
              ArrayList<Flight> wantedFlights = new ArrayList<Flight>();
              synchronized (lock)
                   //some code which selects flights from the HashMap
              return wantedFlights;
    }Now all the Servlet doGet() functions call the getSomeFlights() method. There is also a Timer object which calls the updateFlights() method once every few minutes.
    I need the synchronized blocks in order that the Timer doesn't try to update my object while it is being read by a Servlet however this is not optimal since it also causes each Servlet doGet() to block the others even though it would be possible for to doGet()'s to read the object simultaneously.
    Is there a better way of doing this?
    Thanks
    Aharon

    It is highly unlikely this is a real performance issue for you. Unless you know this is a bottle neck, you don't need to change your code.
    However, as an exercise, you can just use ConcurentHashMap for lockless Map access. However, there is still a risk of getting a read in the middle of a write.
    Instead you can take a snapshot copy of the Map and use this snapshot for reads. See below.
    In term of coding style;
    - I suggest you use the Map and List interfaces where ever possible.
    - You don't need to create a seperate lock object, the Map will do the same job.
    - Use can create the HashMap on the same line as it is declared removing the need to define a constructor.
    public class ActiveFlights {
         private final Map<String, Flight> flights = new HashMap<String, Flight>();
         private volatile Map<String, Flight> flightCopy = new HashMap<String, Flight>();
         public void updateFlights(List<FlightData> newFlights) {
              //some code which updates the HashMap
              // this takes a snapshot copy of the flights.  Use the copy for reads.
              flightCopy = new HashMap<String, Flight>(flights);
         public List<Flight> getSomeFlights() {
              // take a copy of the reference, neither the reference, nor the map it refers to will change over the life of this method call.
              final Map<String, Flight> flightCopy = this.flightCopy;
              final List<Flight> wantedFlights = new ArrayList<Flight>();
              //some code which selects flightCopy from the HashMap
              return wantedFlights;
    }

Maybe you are looking for

  • MSI GE60 2PL Cooling Question

    Hi there, I just bought a MSI GE60 Apache-629 Laptop. I Never owned a MSI Laptop but I am Very Satisfied so Far. Even though it doesn't have the NVidia GTX 860m , like the Apache Pro, I can Still Run Battlefield 4 on Medium Spec in 1920x1080. My Ques

  • Multiple PCI-6110 in one computer - Minimum Computer Specs?

    I am building a computer system which will house 4 PCI-6110's. What minimum processor, RAM etc. is recommended. Also, can you mix the PCI bus speeds without adverse effects? Dell has a model that has 3 100MHz PCI slots and 1 30MHz slot. Would it be a

  • Picture in a picture.

    I want to have a small video picture in the left top corner in my video. A picture in a picture. Is there somebody who knows hove to do it?

  • ORA-1652: unable to extend temp segment by 32 in tablespace TEMP.

    Hello everybody, i have a problem with our temp tablespace: we are running Oracle 9.2.0.5 with 1000 concurrent sessions. I have now the the situation that in the normal buisiness the temp tablespace is full, that means no free space in the tablespace

  • Hope: Continuous Video Playing - Apple-M-TV!

    One of the main reasons I purchased an AppleTV was to utilize it as my personal MTV. I have tons of videos I have purchased, and I want to play them continuously on my big screen TV. So far this feature has been left out. Well iPhone 2.0 will be gett