• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data persistence problem SOLVED

 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SOLUTION - Ended up writing the data to a table and just accessing it in that manner.

Hi

I have some variables and parameters in my store() procedure (in a package called main). These are all set as needed, but the variables and params are losing the saved values when I still need them to save them for later use. Here is the relevant code to help better explain where things go wrong:

The code always goes through the first ELSE. But in certain circumstances it goes through the if statement on line 10. This calls a separate package/procedure (nios_util.client_redirect())
One thing this does is set the action param to 'force_order', thereby going into the logic for the second ELSE. It is also at this point where the params and variables get set to NULL (pon, ccn, pmt, etc).
So when that econd ELSe is triggered, those variables and params no longer have values, and as you can see pmt get set to 'error' which causes problems later in my code.

As of now my solution will be to move the client_redirect() function from the util package to this main package. Then the params and variables will not have a chance to be reset, if I understand what is going wrong.

Is there a better way though?

Am I missing anything anyone can see (such as the params and variables are not getting reset because of this, but something else I do not see?)

Thanks very much
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it mean that sometime ofter you call util.client_redirect(process_url);, the store() procedure gets called again? If this is the case (and it probably is), the new call is a new invocation, possibly in a new session (not enough information to be sure on this). If the variables are local, there is no relationship between values in the invocation that called util.client_redirect(process_url); and any other invocation. If the variables are package variables, then they are session specific and if the call is performed on another session, there is again no relationship between these variables in the two invocations of the procedure.

Moving client_redirect() elsewhere should not affect anything.

You should describe your processes more specifically (what is called from what and when, is a connection pool used, how and where the variables are declared, etc.).
 
Matt Kohanek
Village Idiot
Ranch Hand
Posts: 484
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are right, moving client_redirect() does no good. It does not even help to put the logic from client_redirect() directly where the call to it is, because client_redirect() makes a call to a java app used for student registration. Then that app calls main.store() (as you guessed), and of course at that point everything has lost it's values.

As to your other questions.

A url is hit passing in parameters which is what calls main.store() initially, and thta is how all the values are set - they come in when a certain url is hit from text fields and the like.
The logic makes it to the first ELSE block, which eventually calls client_redirect() - which invokes the java app. I do not know the name of the java app, but it then calls main.store() a second time and forces it into the second ELSE block. But by then everything has lost it's values.

I do not know if a connection pool is used unfortunately - I assume I would need to be more familiar with the java app this calls to know that information.


edit - turns out this may be incorrect. I have a different set of users who go through a very similar process, including the client redirect to the java app, but that data does not get lost. Back to the drawing board
edit 2- turns out this second set of users were succeeding because the data was being written to a table. Then when the call to order() was made blank values were passed in, but as a failsafe for missing values the tables were queried, making it look like this was working just fine. Turns out this needs work too. But it lead me to a temporary solution at least
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic