Design pattern suggestion for multiple PersistenceManagers?

Hi!
I'm getting the following error (see end of message), and I would love to
hear a good design solution.
I get this error when adding a RequestLog object into the db, which
contains a field for User. Now, I pass in the User object and since I am
use a ThreadLocal pool for PersistenceManagers, sometimes the User object
is being monitored by another PersistenceManager.
Firstly, why is that causing a problem? I am not updating or changing the
User object from this RequestLog object?
I attempted to make the User object non-transactional, and I have
javax.jdo.option.NontransactionalRead: true
javax.jdo.option.NontransactionalWrite: true
in my kodo.properties, but that made no improvement.
What is the standard solution to this type of problem?
Thanks!
Nic.
Stack trace:
com.solarmetric.kodo.runtime.UserException: The instance
"com.everwhere.idiomatica.app.security.User" of id
"com.everwhere.idiomatica.app.security.User-0" is not managed by this
PersistenceManager.
FailedObject:User: admin
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1402)
     at
com.solarmetric.kodo.runtime.PersistFCOFieldManager.storeFirstClassObject(PersistFCOFieldManager.java:109)
     at
com.solarmetric.kodo.runtime.PersistFCOFieldManager.storeObjectField(PersistFCOFieldManager.java:78)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.providedObjectField(StateManagerImpl.java:1354)
     at
com.everwhere.idiomatica.app.etc.request.TranslationRequest.jdoProvideField(TranslationRequest.java)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.provideFields(StateManagerImpl.java:2360)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.preFlush(StateManagerImpl.java:2037)
     at com.solarmetric.kodo.runtime.PNewState.beforeCommit(PNewState.java:39)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.beforeCommit(StateManagerImpl.java:597)
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.preCommitCallbacks(PersistenceManagerImpl.java:650)
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:454)
     at
com.everwhere.idiomatica.db.KodoDatabase.insertDirectlyIntoDB(KodoDatabase.java:45)

You cannot share objects directly across multiple pms.
For example:
Person p = (Person) pm1.getObjectById ...
Person p2 = (Person) pm2.getObjectById ...
p.setParent (p2); // bad!
instead you should do:
p2.setParent ((Person) pm2.getObjectById (JDOHelper.getObjectId (p),
false));
This should be a low cost operation (and even more so with L2 caching)
It is usually best to allocate a PM per context so that these
semi-messy situations are avoided.
On Wed, 18 Jun 2003 10:53:09 +0000, Nic Cottrell wrote:
Hi!
I'm getting the following error (see end of message), and I would love to
hear a good design solution.
I get this error when adding a RequestLog object into the db, which
contains a field for User. Now, I pass in the User object and since I am
use a ThreadLocal pool for PersistenceManagers, sometimes the User object
is being monitored by another PersistenceManager.
Firstly, why is that causing a problem? I am not updating or changing the
User object from this RequestLog object?
I attempted to make the User object non-transactional, and I have
javax.jdo.option.NontransactionalRead: true
javax.jdo.option.NontransactionalWrite: true
in my kodo.properties, but that made no improvement.
What is the standard solution to this type of problem?
Thanks!
Nic.
Stack trace:
com.solarmetric.kodo.runtime.UserException: The instance
"com.everwhere.idiomatica.app.security.User" of id
"com.everwhere.idiomatica.app.security.User-0" is not managed by this
PersistenceManager.
FailedObject:User: admin
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.makePersistentFilter(PersistenceManagerImpl.java:1402)
     at
com.solarmetric.kodo.runtime.PersistFCOFieldManager.storeFirstClassObject(PersistFCOFieldManager.java:109)
     at
com.solarmetric.kodo.runtime.PersistFCOFieldManager.storeObjectField(PersistFCOFieldManager.java:78)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.providedObjectField(StateManagerImpl.java:1354)
     at
com.everwhere.idiomatica.app.etc.request.TranslationRequest.jdoProvideField(TranslationRequest.java)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.provideFields(StateManagerImpl.java:2360)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.preFlush(StateManagerImpl.java:2037)
     at com.solarmetric.kodo.runtime.PNewState.beforeCommit(PNewState.java:39)
     at
com.solarmetric.kodo.runtime.StateManagerImpl.beforeCommit(StateManagerImpl.java:597)
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.preCommitCallbacks(PersistenceManagerImpl.java:650)
     at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:454)
     at
com.everwhere.idiomatica.db.KodoDatabase.insertDirectlyIntoDB(KodoDatabase.java:45)--
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Design Suggestions for Multiple DaqMX Task Streaming App?

    I'm working on a LabVIEW application in which I'm streaming high-speed data to disk from multiple PXI devices simultaneously.  Each device has its own DaqMX task, and all tasks stream to the same file.  The PXI device configuration (which devices are in the chassis, which slots they're in, and which channels to read from each device) is determined at runtime.
    Does anyone have a suggestion for a design model for this?  To make matters worse, I'd like to be able to specify a channel to monitor its data during the streaming.  I'm thinking the Producer-Consumer model is the basic approach, and I'm at the point where I have an array of DaqMX tasks, one for each device.  I could probably extend that array to be an array of clusters containing:
       1) DAQ Command (e.g. Initialize, Start, Stop, Acquire, etc)
       1) Task ID
       2) Control reference to 2-D array (where each DaqMX read can be stored)
       3) Array of channel names (to allow selection of channel to be monitored
    This could be passed as notifier data, to a data collection subVI, but the part I'm struggling with is finding the best way to run X number of tasks in parallel, where X is not known until runtime.
    Any suggestions would be appreciated.

    Thanks for the input.  With regards to the file format, the decision has been made by my superiors not to use TDMS - unfortunate, but NI hasn't provided the information to write a MatLab file reader, which is a requirement.  So, I've created a custom file format tailored to the needs of my application, but generic enough to be used for other apps. With it, I've been able to stream 8 channels at 800KHz (4 channels each from 2 PXI-6120s) without breaking a sweat.  However, the performance varies greatly depending on which slots the cards are in (but that's a whole different discussion - see the PXI forum for that one).  Once NI solves that one, I'll feel a lot more comfortable.
    I have already made reentrant subVIs that can perform a specific DAQ task.  The problem with a for loop is that the VI sits and wait for a start trigger, then acquires the streaming data.  I can't start the next VI because I'm in the first one.  I thought about creating a data collection VI, and this VI would start up to 6 other VIs in parallel, based on how many and which cards were present.  It's a bit messy, because each slot can contain one of two devices, so I'd need to check which type it was before calling it.  I'm thinking I'll have to create the task list and the references to the data in the main GUI loop, and then pass this using a notifier or queue to the data collection loop. 

  • Drive setup suggestion for multiple users editing simultaneously?

    At work here, a city college, not a professional company or broadcast studio, so resources are limited, we often have three people editing HDV content simultaneously in Final Cut Pro.
    Keeping the content on our multiple backup servers, there's simply too much network traffic to do this smoothly.
    Instead of keeping projects locally spread across multiple machines, I would like one centralized place for everything, for the Macs to access directly over gigabit or something else.
    So, what kind of setup do you guys suggest for this?
    The machines here are two quad-core G5s (no RAID or fiber-channel right now), and a Core2Duo iMac, F400 only.
    Again, it'd need to be able to handle three HDV projects going on simultaneously without skipping due to having to seek back and forth all over the drive.
    Thanks.

    Yes, an XSan system would perfectly fit the bill for what you want to do, but an XSAN is not a cheap solution. When it is all said and done, it will cost you tens of thousands of dollars.
    The best, cheap solution would be to use Firewire drives. I would not duplicate a project onto three drives, because you will then always be trying to figure out which version is the most current. Instead, keep all of your project, capture scratch and render files on the firewire drives. Then move the drive to whichever computer you want to do the editing on.
    Properly log & capture all your footage, then archive all your project files, because Firewire hard drives will fail over time, loosing all the info on the discs. I did say this was the cheap solution. "Cheap" does have its costs…

  • Observer Design Pattern: Looking for redesign ABAP OO code example

    Hello folks,
    I am looking for an example for ABAP OO code that has been redesigned by applying the Observer Design Pattern. I would be very interested in both the code before as well as the code after the pattern is being applied.
    Thanks in advance and kind regards, Alex

    Observer can be implemented using the EVENTS.
    I had recently implemented the observer at one of my client's place. I had screen with so many ALVs. One ALV was kind of editable and other were just showing the information of the current row as well as some total information. So, initially I started with the Main ALV and SUB(1 and 2) for other ALVs. Now, when I need to refresh my ALVs based on the main ALV data, I had to explicitly update the data of the each Sub ALV. The code was kind of static and requirement was not yet fixed.
    Later on we need to add one more ALV on the same screen. It was easy to change the existing method where I was doing the explicit refresh of each ALV. But I thought of using the Events.
    I created an event REFRESH_DETAILS for main ALV. so, when data gets changed (which I was catching by DATA_CHANGED event of ALV), I raise the event.
      RAISE EVENT REFRESH_DETAILS
        exporting new_data = it_Data.
    In Sub ALVs, I created the event handler method to handle the event REFRESH_DETAILS of the main ALV.
      methods: handle_refresh_details
          for event REFRESH_DETAILS of ZCL_MAIN_ALV.
    I also had to register the Handler.
      SET HANDLER me->handle_refresh_details FOR ALL INSTANCES.
    I'll soon write a post on my [ABAP Help blog|http://help-abap.zevolving.com/] with all the details.
    Regards,
    Naimesh Patel

  • Idea for iTunes: Slideshow for "Now Playing" (new suggestion for multiple artwork in one song)

    As some may know, you can put more than one album art (picture) in a song. When it's done, the "Now Playing" window, which usually showcases the artwork of the song playing, would have a small right/left arrow beside it. When pressed, you switch to a new artwork.
    However with the recent updates on iTunes, that arrow button's disappeared. Now it's as pointless as ever to put multiple pictures. My purpose with this feature is to put album covers and the single artwork together, only if they are the first tracks of whichever album. (Yes, I like to stare at the album covers while listening to music).
    IDEA - Why not have the "Now playing" window fade between pictures like a slideshow? So for example, Kelly Clarkson's "Stronger" album's 1st track "Mr. Know It All", a single that bears its own artwork. Putting the album and single cover in the song while playing, they'd alternate between pictures every 5 seconds.
    I just think that if you can put more than one picture in a song, might as well make use of it. There are a lot of albums that have singles as track no.1. Some have a great single artwork but can't be shown because it needs the album cover. This would make a great compromise. It might even be more neat to put a real life picture of you or someone or a place you know because the song reminds you of .
    What do you guys think?
    (Say is this normally the way to suggest them ideas or do I just e-mail them a customer support form?)

    Since this is a user-to-user forum, for better results with Apple, give them feedback at:
    http://www.apple.com/feedback
    That will get the informatin to Apple.

  • How to design interactive pdf. for multiple additions and saves???

    Using LiveCycle designer -  Can anyone clarify how we can let others make multiple additions and saves to an interactive pdf. I created in Live Cycle Designer 8.2.1...
    I have created an interactive pdf. with LiveCycle designer and sent to client.
    Is there any way I can give them ability to save the pdf. make  multiple additions and saves and send back when they have completed it?
    or even pull up the file make changes and resend at some point in the future without having to fill in all form field again?
    Thxz much,
    JR

    Sorry but this is the wrong forum (this is for the Collaboration Services). You may want to try the LiveCycle Designer forum:
    http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_designer_es

  • Slideshow for "Now Playing" (suggestion for multiple artwork in one song)

    As some may know, you can put more than one album art (picture) in a song. When it's done, the "Now Playing" window, which usually showcases the artwork of the song playing, would have a small right/left arrow beside it. When pressed, you switch to a new artwork.
    However with the recent updates on iTunes, that arrow button's disappeared. Now it's as pointless as ever to put multiple pictures. My purpose with this feature is to put album covers and the single artwork together, only if they are the first tracks of whichever album. (Yes, I like to stare at the album covers while listening to music).
    IDEA - Why not have the "Now playing" window fade between pictures like a slideshow? So for example, Kelly Clarkson's "Stronger" album's 1st track "Mr. Know It All", a single that bears its own artwork. Putting the album and single cover in the song while playing, they'd alternate between pictures every 5 seconds.
    I just think that if you can put more than one picture in a song, might as well make use of it. There are a lot of albums that have singles as track no.1. Some have a great single artwork but can't be shown because it needs the album cover. This would make a great compromise. It might even be more neat to put a real life picture of you or someone or a place you know because the song reminds you of .
    What do you guys think?

    hi
    I agree - and was glad to see this post and intend to search for more. I vaguely recall some kind of multimedia artwork to replace and extend the idea of the printed album cover being talked about. Was that a standalone package one bought?
    Animating covers and album info - some albums I have eg one I just put in itunes - has 87 pages of info - and one track is 70 minutes long. I would like to read that info as it plays (without starting up several other programmes and searching for the docs!)
    It is a multimedia environment so why not have an interactive 'now playing' window that plays related videos - pdfs - as well as stills or EVEN! that can actively search (say google images? or tagged info from wherever) for related pictorial content or other info. I have tried dragging pdfs into the artwork box but it wants the pdfs pages made into jpgs first and separated - altho they can ALL be added at once.
    Maybe theres already a script to do this stuff?
    Sorry to over extend that idea! But really its quite stupid at present not even to be able to see the other stuff one has put in the artwork box - and it even took a while to guess it could be used (as simple as drag and drop..)
    I had no idea the 'now playing' window had buttons - where have they gone!

  • How to disable a custom designed Tx code for multiple user at a time

    Hii ,
    I have designed a screen in module pool for end user to make entries in the screen and when he saves the data is saving in standard table and ztable. the main field in the screen is Batch number..from that batch  number bag number will be generated. and consumed quantity will be saved in that bag no.Bag number will be generated like first 5 digits of batch number and bag number series of that batch number. for example if batch number is 12345 and already 5 times packing is done for same batch..last bag number in the ztable will be 123450005.so next time when user tries to pack using same batch number the new bag number will be 123450006 for batch 12345.Problem here is when user tries to make enrties in that Tx code and at the same time if another user opens same Tx code to make packing for same batch both of them are getting same bag numbers before saving.
    I have called Enqueue and Dequeue FM's but still at a time for same batch user is able to do the packing.now my issue is i want to restrict 2 user to use same batch while packing in that Tx code.
    I have written following code for enqueue and dequeue technics
    data: B_matnr type mara-matnr,
           B_charg type mchb-charg.
    data : i_temp type TABLE OF zpackhdr WITH HEADER LINE,
           i_temp1 type TABLE OF zpackhdr WITH HEADER LINE.
    move : 1110 to WA_BCH-werks,
           chk_matnr1 to WA_BCH-matnr,
           v_bcharg to WA_BCH-charg,
           vgrade to WA_BCH-grade,
           new_batch to WA_BCH-bagno,
           m_baleno to WA_BCH-baleno,
           b_date to WA_BCH-indat.
    APPEND wa_bch to i_bch.
    clear b_date.
    READ TABLE i_bch INTO wa_bch INDEX 1.
        B_MATNR = WA_BCH-matnr.
        B_CHARG = WA_BCH-bagno.
    concatenate  B_matnr B_charg  into
        WA_BCH-objek respecting blanks .
       modify I_BCH from WA_BCH index sy-tabix.
    CLEAR: B_MATNR,
               B_CHARG.
    call function 'ENQUEUE_EMMCH1E'
    EXPORTING
       MODE_MCH1            = 'E'
       MANDT                = SY-MANDT
       MATNR                = WA_BCH-MATNR
       CHARG                = WA_BCH-BAGNO
    if sy-subrc <> 0.
    endif.
    call function 'DEQUEUE_EMMCH1E'
    EXPORTING
       MODE_MCH1       = 'E'
       MANDT           = SY-MANDT
       MATNR           = WA_BCH-MATNR
       CHARG           = WA_BCH-CHARG

    I do understand what u say...mine is a custom designed screen...when i open that screen i have around 15 input fields in which batch is obligatroy...when i give batch and hit enter all the other fields will be filled automatically picking from the table which are relevant for that batch..for example..material,order etc are picked from table...and bag number field will be generated taking first 5 digits of batch and followed by 0001 if its afirst time entry for that batch....so when a user is opening that screen in 2 different windows and giving details without saving any of the screens...in both screens bag number is generating as 001...and when saving it ..its saving 2 entries with same bag number...so i have created a lock entry for afpo table taking order field...so when a user opens 2 screens with same batch...and giving entries in those 2 screens without saving..he is getting same bag numbers as 001.....now when user saving the first screen and coming to second screen to save...he is gettimg message 'ORDER CURRENTLY BEING PROCESSED'..but after the data gettng saved in first screen,then when he saves the second screen it is getting saved...with same bag numbers as 001.so my issue is here...when he saves first screen and comes to second screen to save it the user should get that error message and should come out of the screen....so that he can make a fresh entry for that batch and bag number will be generated as 002 for that batch...
    Regards,
    venkat.

  • Design Patterns needed for SAP XI

    Hi

    hi,
    Here are the general step for designing for file to r/3 integration using IDOC,RFC
    After doing this ull get good idea abt the sap xi designing
    To Configure the FILE TO SAP R/3 OR SAP R/3 TO FILE, proceed as follows:
    Step1:Repository
    1      From the Integration Builder page, select “Integration Repository”. This will launch the Java Web Start Application. Log with the User id and password from the  Integration Server.
    2.      Choose Tools->Transfer from System Landscape Directory->Import Software Component Versions
            From the list of Software Component Versions, Choose your own software component version .Click Import.
    3      On the left hand side frame ,software components will appear .Select your own software component. Open your own software component. Double click on this  software component. A screen will appear .Switch to display mode. After doing this first add  a namespace under Namespaces.
            The namespace should always begin with urn:
    4.     Then choose the Radio Button ->Import of RFC AND IDOC interfaces from SAP systems permitted
         After this specify the connection parameters to the R/3 system:
         System  : Name of sap R/3 system
         Client     : Sap R/3 client number
         These two fields are mandatory. You must Specify these fields.
         Then Save it. The new namespace will be visible under software component version node in the left frame.
         Under the namespace node,  you will find the section Imported Objects. Right click on it and choose Import of sap objects. A wizard will display. In the wizard provide the following details.
    Application server:IP address of sap r/3 system.
    System number: Number of sap r/3.
    User name: user name of sap r/3 .
    Password: Password of sap r/3 system.
            Then click continue .You will find IDOC and RFC node. Click on this node and select the   Idoc or Rfc which is to be imported from R/3. Click Finish to start the Import. Close the wizard. After doing this the   Rfc and  Idoc will be available into XI as Message types. So no need to create any Rfc or Idoc Structure. We need to create a structure for file only.
    5.      Under your namespace in the left frame, expand the node “Interface objects”. You will find a node “DATA TYPES”
    6       Create new data types.
            Right click on “Data types” and select “New”.  Give a suitable name to Data Type(DT_datatype). In the data type Editor ,Create a structure having Elements of type String  ,  integer,  Boolean , Float etc as per the requirement.
            Save the object.
    6.2     The Import function for XSD  files enables you to upload message definitions from external sources. The object type “External Definition” is a container to make external definitions available in the Integration Repository.. While Importing the XSD files from “External Definition “
            no need to create Data types. They are imported directly as Message types.
            To do so, In the left hand frame  Under  ” Interface objects” Create a new object of type “External Definition” and give name to it.
         Select the following.
    Category: XSD.
    Messages: From All Available Global Elements.
    File: Here we need to specify the file name(file.xsd)
         Once the XSD is imported, click on “Message” tab , You should be able to see 2 messages(Request and Response)
    7.       Create a new Message  Type.
    7.1      In the left hand frame under “Interface objects”, right click on the “Message types” and select new.
    7.2      Give a suitable name to the Message type.(MT_ messagetype).
    7.3      For the section “Data type used” you can go to input help (F4) or Search help provided and choose your data type (DT_datatype) from there.
             Save it.
    8.         Create a “Message interface” from the left frame and name(MI_ messageinterface) it.The interface Should be  Inbound or Outbound and mode should be Asynchronous  .It should reference your Message type(Use F4 or Search help).
               Save it.
    9.         Create a graphical mapping  between the target document and the sender .
    9.1        In the left hand frame ,expand “Mapping objects”. Right click on “Message mapping” and name it.You are now in a graphical editor.The Source message is on left, the Target message is on right.
    9.2        As Source message select  your own Idoc , Rfc  or Message type.You can choose “Search  for Integration Object”.As a reminder you can find your Idoc or Rfc under Software Component-  >     Namespace->Imported Objects.
    9.3       As Target Message you can choose your Message type or Idoc, Rfc .Choose “Search  for Integration Object”.
    9.4      Now that we have defined the  Source and Target message, we can start defining the Mapping rules.
    9.5       Map the fields of  Source document  to the equivalent fields in  Target document .This can be achieved easily by locating the field in Target document and then Drag and Drop the   Source fields to the respective Target Fields.
         Save It.
         You can also Test your Mapping by selecting the Test Tab.
    9.6     Fill in the values in the Idoc fields and click Start Transformation. On the right hand side you will see Target Document populated with the appropriate Values.
    10.      Create an “Interface Mapping”.
         In the left hand Frame  expand “Mapping objects”. Right Click on “Interface Mapping” and  Name it. You are in a Interface Mapping Editor .Assign the following References.
    Source interface : Your Outbound Interface (Idoc from the Software component Version).You can Choose” Search  for Integration Object”.
    Target interface:    Your Inbound Interface( The Target document interface).
         Then Select  Read Interface and Assign your “ Mapping Program” .
    Mapping Program: Your Message mapping.
         Then Save it.
    11.      Finally , in the left hand frame ,go to your change list and Activate it.
    Rewards points if helpful
    Vikas

  • Choice of design pattern for data acquisition system

    Hello all
    I have a trouble about selecting the suitable design pattern / architecture for a data acquisition system. 
    Here is the details of the desired system:
    There is data acquisition hardware and I need to use it by observing parameters on User interface. 
    the data acquisiton period, channel list to scan should be chosen on User interface. Besides, there are many user interface interactions. e.g. if user selects a channel to add scanlist, then I need to enable and make visible some other parts on user interface. 
    When user completes the channel selection, then he will press the button to start data acquisition. Then I also need to show the scanned values on a graph in real time and log them in txt file.
    I know that I cannot use producer consumer pattern here. because the data acquisition loop should wait for parameters to scan channels. and it works in a given period by user. so the user interface loop performs higher rate then consumer loop (data acquisition loop). it means queue will be bigger bigger. if I use notifier it will loss some data come from user interface. 
    is there any idea about that ? is there any suitable design pattern for this case ? 
    Thanks in advance
    best regards 
    Veli BAYAR
    Embedded Systems Software and Hardware Engineer 
    "You live in a graphical world. Why not program in one?"
    Solved!
    Go to Solution.

    johnsold wrote:
    Veli,
    I recommend the Producer/Consumer model with some modifications.
    You might need three loops.  I cannot tell for sure from your brief description.
    The User Interface loop responds to the user inputs for configuration and start/stop of acquisition.  The parameters and commands are passed to the Data Acquisition loop via a queue. In this loop is a state machine which has Idle, Configuration, Acquisition, and Shutdown states (and perhaps others). The data is sent to the Processing loop via a different queue. The Processing loop performs any data processing, displays the data to the user, and saves it to file. A notifier can be used to send the Stop or shutdown command from the User Interface loop to the other loops.  If the amount of processing is minimal and the file write times are not too long, the Processing loop functions might be able to occur in the Timeout case of the UI loop Event structure.  This simplifies things somewhat but is not as flexible when changes need to be made.
    I am not sure that a Design Pattern for this exact setup exists but it is basically a combination of the Producer/Consumer (Events) and Producer/Consumer (Data) Design Patterns.
    Lynn
    Check out this thread: http://forums.ni.com/t5/LabVIEW/Multiple-poll-case-structures-to-event-help/td-p/2551309
    There are discussions there about a 3-loop architecture that may help you.
    Jeff
    Jeffrey Zola

  • Design Pattern for multithreaded client server program

    I asked this question in another post, but with other stuff, so I'll distill this one.
    I am creating a multi-threaded client server program (just for learning - a chat program at this point). I built the server and client in swing, and I'm wondering what the best design pattern is for this setup. Right now all the swing stuff is in the MyServer class. In that class I have a loop accepting client connections to the serverSocket and creating a new MyServerThread (threaded client connection).
    The problem is that all the work of creating input streams, interacting with the server, all that stuff is done in the MyServerThread class, but I want that text to be written up to the Swing objects - which is in the MyServer class. So right now in the MyServerThread class I pass the MyServer object into it, but I'm not sure if that is really the most robust thing to do. Does anybody have any suggestions as to how this should be done. If somebody has an article they'd like to point to I'll check it out too. But if it's just the run-of-the-mill multithreaded client-server article, I've read alot and most don't specifically address my question.

    Thanks for the reply Kaj, and I think I'll keep my design for now, since it's just quick and dirty. I've read the MVC concept a while ago and I'll revisit it again when I get more serious. But I have a question, why should I be using a callback interface, why an interface at all? And then make MyServer implement that interface...why not just pass MyServer to the thread object? Or is there something down the line that I did not forsee?

  • How to create plug and play design pattern on a environment

    Hi All,
    Help me to get a best design for my problem statement.
    Problem Statement: I have to create a platform where I should be able to plug and play different components. explaining better with example
    Example:
    1. I have to create a platform for school
    2. In this school platform we have to plug in multiple components like "Student", "Teacher", "Subjects", "ClassPeriods" etc.,
    3. These components should be easily plug/unplug and play
    4. Like, the component "ClassPeriods" want to purchase from Vendor 1 and plug it to "School" platform it should work.
    5. Incase if we want to unplug the "ClassPeriod" component provided bfy Vendor 1 from "School" platform and want to plug the "ClassPeriod" from Vendor 2. then the Design should support without any extra effort.
    Suggest me the best design pattern for the problem
    This design pattern is for ASP.Net
    Thanks,
    S.Kannan

    Sounds like you're looking at 'Composition'. As a background, and possible solution, take a look at MEF;
    http://mef.codeplex.com/
    http://pauliom.wordpress.com

  • ABAP objects design patterns

    hi all,
        can any one send me the Design patterns used for ABAP objects programming in ABAP. eg mvc and sample code which uses the design patterns
    cheers
    senthil

    Of course that program is not an object design pattern
    (Its just a little ABAP Objects syntax demo that I wrote  years ago
    I don't know about a list of OO design patterns implemented in ABAP Objects.
    A very simple one, a Singleton might look like this:
    <b>* cl_singleton: Eager Variant
    CLASS cl_singleton DEFINITION FINAL
                                  CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS: class_constructor,
                       get_singleton RETURNING VALUE(singleton)
                                               TYPE REF TO cl_singleton.
      PRIVATE SECTION.
        CLASS-DATA singleton TYPE REF TO cl_singleton.
    ENDCLASS.
    CLASS cl_singleton IMPLEMENTATION.
      METHOD class_constructor.
        CREATE OBJECT singleton.
      ENDMETHOD.
      METHOD get_singleton.
        singleton = cl_singleton=>singleton.
      ENDMETHOD.
    ENDCLASS.
    cl_singleton: Lazy Variant
    CLASS cl_singleton DEFINITION FINAL
                                  CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS get_singleton RETURNING VALUE(singleton)
                                              TYPE REF TO cl_singleton.
      PRIVATE SECTION.
        CLASS-DATA singleton TYPE REF TO cl_singleton.
    ENDCLASS.
    CLASS cl_singleton IMPLEMENTATION.
      METHOD get_singleton.
        IF cl_singleton=>singleton IS INITIAL.
          CREATE OBJECT cl_singleton=>singleton.
        ENDIF.
        singleton = cl_singleton=>singleton.
      ENDMETHOD.
    ENDCLASS.</b>

  • For multiple item selection in Table

    Plz use this code and paste it in perticular event of button. when u excute the application ,To select multiple items plz catch shift in keyboard otherwise u can select only single item.
    int n = wdContext.nodeProducts().size();
        int leadSelected = wdContext.nodeProducts().getLeadSelection();
        // loop backwards to avoid index troubles
        for (int i = n - 1; i >= 0; --i) {
          if (wdContext.nodeProducts().isMultiSelected(i) || leadSelected == i) {
            wdContext.nodeProducts().removeElement(wdContext.nodeProducts().getElementAt(i));

    Hi Vishal
    Thats the way the webdynpro table has been designed to work for multiple selection...on click of the Ctrl key or Shift key. There is no other alternative for this.
    What would your question be?
    Thanks
    oj

  • Suggest good book for J2EE Design Pattern.

    Is there any good book for J2EE Design pattern? I know Head First Design Pattern book, but is focuses oncore java. I want to learn in detail with examples J2EE design pattern.
    Please suggest good books.
    Thanks in advance.
    Rahul.

    most j2ee patterns are discredited now. they were mostly workarounds for deficiencies in ejb 1 & 2 specs.
    "core j2ee patterns" is your best bet, but take it with a grain of salt.
    better to learn spring, IMO:
    springframework.org
    %

Maybe you are looking for

  • Change font size in Jdev?

    I have a monitor with fine dot pitch, so I want bigger fonts. I found Tools->Preferences->Code Editor->Fonts, but this only changes the editing window. Is there some way to scale up the fonts everywhere (editing window, menus, logs, navigators, etc.)

  • Create materialized view as part of refresh group

    Hello, When I create a materialized view in 11g it automatically creates its own refresh group. How can I create the materialized group as part of an existing refresh group? (I know I can drop the individual refresh group and add the mview to the mai

  • GL Balance display  using S_ALR_87012277

    Hi All,    When we execute the report S_ALR_87012277 we get output in normal report format. If we want to export this report to excel file, the data in file is not formated correctly and it's time consuming to format that. Just like FBL3N do this rep

  • Drag n Drop in JDK 1.4

    I have a set of components that are enabled and disabled for DnD based on some criteria. Previously (in JDK 1.3), i would use that criteria to alternatively call acceptDrag(...) or rejectDrag() in the dragEnter and dragOver functions of each DnD comp

  • .JPG Speed

    Ok, as I know a lot of you pros out there have mentioned that Aperture is slow. My question is, why is it so slow with .JPG. I've only shot with RAW a few times, so the average file on my system is about 500k in size. While I have a lot of images (ap