• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ConnectionFactory coding the hard way

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setup

the server will bind the connection factory ,along with itself
when started. also the client will be having the hard coded
values for getting the new connection thr' the connection
factory. will it be ok???

1) do i need to ask for the connection factory parameters
(port and host) whenever i start the server along with the
server parameter(port, dbpath and host).

2) i assume hard coding for the client is ok as in my current
setup the connection factory will be binded at 1099, the default
port. else i will ask for both the connection factory as well
as the server parameters when the client chooses a remote
connection.

please help with your advice
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the server will bind the connection factory ,along with itself

Hmm, I thought the ConnectionFactory was the only class needed to be binded?
As far as hard coding the location of the server in the client. That is not a good idea, How do you know what the Assessor's IP address is?
Mark
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Spritzler:

As far as hard coding the location of the server in the client. That is not a good idea, How do you know what the Assessor's IP address is?
Mark

Yes, you are right. if i understand correct then the user should provide the dbFilePath, port and hostname/ip for the connection manager. i have it that way because i thought the server too will be in the registry and you can't bother the user with details both for server and connection factory.
Originally posted by Mark Spritzler:

Hmm, I thought the ConnectionFactory was the only class needed to be binded? please comment.

i thought server should also be bind in the registry so that the client will communicate with the server thr' the server stub.

i will check if the above code works and if it did , i will conclude that the server need not bound to the registry. but other than lookup, is there any use of binding the server in registry .
please let me know if i miss something here.
 
Brian Blignaut
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have allowed the client to specify the host name of the server when he connects. i.e. I have a connection dialog that allows the user to select a local or remote connection. If a local connection is selected I use the value specified as a startup parameter as the database filename. If however the user chooses a remote connection I allow him to enter a hostname to connect to.
Any comments?
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it works without the server being bound in the registry. the Factory is redirecting the requests to the server .
WOW!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic