Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #22 on issue 598 by michael@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times https://code.google.com/p/google-guice/issues/detail?id=598 Just AbstractModule. In the end it's the JpaPersistModule that gets installed; it just gets some bindings overridden by YourCustomizedPersistModule. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #18 on issue 598 by ethan.hu...@web.de: Persist Extension: PersistService.start() cannot be called multiple times https://code.google.com/p/google-guice/issues/detail?id=598 Hi, overloading might work if I trick package visibility of JpaPersistService by faking package structure com.google.inject.persist.jpa in my project to be able to extend JpaPersistService, but JpaPersistModule also binds JpaPersistService and guice complains about A binding to com.google.inject.persist.PersistService was already configured at com.google.inject.persist.jpa.JpaPersistModule.configurePersistence(...) And overriding configureServlets() of JpaPersistModule() does not work, because this class is final. Any other ideas? regards Patrick -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #20 on issue 598 by michael@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times https://code.google.com/p/google-guice/issues/detail?id=598 install(Modules.override(new JpaPersistModule(yourjpaunitstring)).with(new YourCustomizedPersistModule())); where YourCustomizedPersistModule does the bindings I showed previously: @Override protected void configure() { bindConstant().annotatedWith(Jpa.class).to(yourjpaunitstring); bind(Properties.class).annotatedWith(Jpa.class).toInstance(new Properties()); bind(PersistService.class).to(YourCustomizedJpaPersistService.class); bind(JpaPersistService.class).to(YourCustomizedJpaPersistService.class); bind(YourCustomizedJpaPersistService.class).in(Singleton.class); } -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #12 on issue 598 by terciofi...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 I just don't get the point not to allow restarting. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #13 on issue 598 by guillaum...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 I don't get it either. In the context of unit tests, it is very useful to be able to create an EMF pointing to an in-memory database which gets created upon the service start and deleted when the service stops. Allowing to restart, actually allows to execute several unit-tests. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #14 on issue 598 by dha...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 It's pretty simple to just create a new injector for a new unit test isn't it? I don't think it's the right pattern to share the Injector + PersistService across unit tests... -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #15 on issue 598 by terciofi...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 My situation is kind of different. I start the persistence service, get some info from the database, re-configure the application and start the service again. I cannot create a new injector, all the dependencies in my application have already been binded. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #11 on issue 598 by dha...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 I don't think we should allow restarting a PersistService. Other options are: - instead you can create a new Injector/PersistService combination - user a child-injector (or PrivateModule) to isolate different persist services We can add the isActive() method. However I am loathe to assume arbitrary ordering of service starts. If you install the PersistFilter it should give you a strong guarantee of having initialized the service when the filter is ready to receive requests. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/d/optout.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Updates: Labels: -Extension-Persist Component-Persist Comment #10 on issue 598 by sberlin: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 (No comment was entered for this change.) -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/groups/opt_out.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #8 on issue 598 by xavier.d...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 In the meantime, what I do is bind an interceptor around PersistService.class which swallows IllegalStateExceptions... -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/groups/opt_out.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #9 on issue 598 by terciofi...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 @xavier, the problem is not the exception itself, but the fact that we cannot re-start the PersistService. Sometimes I need to start, do same job, stop and start again after some modifications to the configuration in runtime. Do you accept patches? Seriously, more than 2 years to set a variable to null. -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev. For more options, visit https://groups.google.com/groups/opt_out.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #7 on issue 598 by guillaum...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 Any chance this issues gets solved at some point? This would really be helpful in the context of tests where (in-memory) databases needs to be created and then dropped (which can easily be achieved by closing the EMF). -- You received this message because this project is configured to send all issue notifications to this address. You may adjust your notification preferences at: https://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To unsubscribe from this group and stop receiving emails from it, send an email to google-guice-dev+unsubscr...@googlegroups.com. To post to this group, send email to google-guice-dev@googlegroups.com. Visit this group at http://groups.google.com/group/google-guice-dev?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #5 on issue 598 by psa...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 There is another related problem: Sequence start() - stop() - start() throws the same exception even if the restart should be possible. The reason is that start checks for the emFactory to be null but it is never reset on stop(). public synchronized void start() { Preconditions.checkState(null == emFactory, Persistence service was already initialized.); ... } public synchronized void stop() { Preconditions.checkState(emFactory.isOpen(), Persistence service was already shut down.); emFactory.close(); } -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To post to this group, send email to google-guice-dev@googlegroups.com. To unsubscribe from this group, send email to google-guice-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Updates: Labels: Extension-Persist Comment #4 on issue 598 by sberlin: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 (No comment was entered for this change.) -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To post to this group, send email to google-guice-dev@googlegroups.com. To unsubscribe from this group, send email to google-guice-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
Re: Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Comment #3 on issue 598 by sberlin: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 Issue 605 has been merged into this issue. -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To post to this group, send email to google-guice-dev@googlegroups.com. To unsubscribe from this group, send email to google-guice-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
Issue 598 in google-guice: Persist Extension: PersistService.start() cannot be called multiple times
Status: New Owner: New issue 598 by michal.g...@gmail.com: Persist Extension: PersistService.start() cannot be called multiple times http://code.google.com/p/google-guice/issues/detail?id=598 The PersistService.start() method claims that it is possible to call this method multiple times. The implementation however throws java.lang.IllegalStateException: Persistence service was already initialized. on second call. This is a problem since it is not possible to determine if the service was already started. Moreover the PersistFilter starts the PersistService in initialization. Therefore it is not possible to use the persistence in any ServletContextListener! -- You received this message because you are subscribed to the Google Groups google-guice-dev group. To post to this group, send email to google-guice-dev@googlegroups.com. To unsubscribe from this group, send email to google-guice-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.