sorry, can't answer specific Q on whether you can access datasource from
generator.  but it sounds like you are trying to uniquely ID rows in a
database?

if so then the simplest way seems to be to use auto_increment fields and let
the database handle it.  or are you saying that that isn'y working - is this
what you mean by "not supporting the database-generated id-numbers"?  if so
please say more about why its not working.  what database? code sample?

> -----Original Message-----
> From: Roland Carlsson [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday 27 October 2004 11:49
> To: TomcatUsers
> Subject: GlobalNamingResouces used by other GlobalNamingResources
> 
> 
> Hello again!
> 
> Sorry to bother in this topic again but I need to strait out 
> one more thing.
> 
> I have my Datasource now as GlobalNamingContext (and a big 
> post-it saying
> that I shall change the resource-link from DefaultContext).
> 
> Since JDBC doesn't generate id-numbers and not supporting the
> database-generated id-numbers I have written an id-generator 
> that takes care
> of the problem. It works fine for a single web-app using its 
> own private
> database but is trouble when two web-apps uses the same 
> database since it's
> awful hard to keep the generators synchronized (even worse using to
> tomcat-instances). 
> 
> So, for a breif moment I thought that I had the solution putting the
> id-generator as a Resource under GlobalNamingResources. And 
> that would have
> worked if I didn't the init the id-generator with a call to 
> my datasource
> that also is in the GlobalNamingContext.
> 
> javax.naming.NameNotFoundException: Name comp:java is not 
> bound in this
> Context was the result.
> 
> So, before I start to rewrite my id-generator i would like to 
> get a few
> things clarified.
> 
> 1) Can I in any part of my id-generator (assuming that it is 
> defined in the
> GlobalNamingResources) use my datasource. For example after 
> the "user" have
> done a lookup and calling the generate-method? What context 
> will be used in
> that case? 
> 
> 2) Since we are closing in on the fact that or single 
> tomcat-server sone
> will not cope with the load its carrying in the peeks. Would 
> there be a
> better way to implement the id-generator? (rmi, webservice etc etc)?
> 
> Thank you very much in advance
> Roland Carlsson
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to