Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to transfer objects across servers?

 
Gaurav Kr. Arora
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Am using RMI Spring capablilites and new to this framework.

In my application there is a client which access a service running on server using RMI Spring. Now, if maximum no. of users to that service connect, connection refuse exception is thrown and I am catching it and then transferring the control to another server which runs a backup service and performs the same task.
The task is simple. We are adding user names to an arraylist.

Problem: Arraylist to which users are getting added is local to each of the server and when control transfers to new server after exception has occured, the users get added to the arraylist which was created at the new server.

How can the same arraylist object be shared across the servers/application, so when the exception occurs or doesn't occur, program continues to add usernames in the same arraylist?

Please suggest.

Thanks.
 
Bojan Tomic
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't completely understand what you're doing, but in order for two distinct JVMs (as I reckon you have) to operate on the same component, that component should be somehow exposed. Through an EJB, RESTful interface or anything really, as long both apps can see it and use it... You can't directly just share an object between JVMs.... well, you probably can, but that's hardly what you need here... I guess.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic