Juan Hernandez has posted comments on this change.
Change subject: core: Locate data source in a loop
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacadeLocator.java
Line 42: if (datasource != null) {
Line 43: break;
Line 44: }
Line 45:
Line 46: // Tell the user that the lookup failed but that we
will try
Yes, we can assure that the engine is the only application running inside the
application server (well, the engine and maybe the reports). We run the engine
in its own instance of the application server for that very reason.
Line 47: // again in a few seconds:
Line 48: log.warn(
Line 49: "The datasource can't be located. This probably
means " +
Line 50: "that DNS is not working correctly or is slow,
please " +
Line 51: "check it. Will try again in a few seconds.");
Line 52:
Line 53: // Wait a bit before trying again:
Line 54: Thread.sleep(DEFAULT_INTERVAL_VALUE);
Line 55: }
Yair, the @Depends annotation doesn't exist in JBoss 7. It has been replaced by
the @DependsOn standard annotation (starting with EJB 3.1 and EE 6). But this
annotation isn't useful for dependencies on resources, only for dependencies on
other EJBs.
If we want to add a dependency on the data source then we need to use the
@Resource annotation, something like this:
@Resource(mappedName="jdbc:/ENGINEDataSource")
private DataSource ds;
And this would need to go into a managed component, as injection only works
there, so we would need to make the DbFacadeLocator an EJB (it could be a
@Singleton). That will in turn change the way it is used: it would need to be
located using JNDI as any other EJB. This would complicate the code and the
tests.
Do you want to go this way?
Alissa, the JBoss modules and their dependencies are defined correctly, but
that is mostly not relevant in this case, as JBoss modules are only used to
determine which classes can be loaded, not when they are loaded or when are
instances created.
Line 56:
Line 57: // Create the facade and return it:
Line 58: dbFacade = new DbFacade();
Line 59: dbFacade.setDbEngineDialect(loadDbEngineDialect());
--
To view, visit http://gerrit.ovirt.org/10189
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I72c99c61d05e8a1619c7d1fb70af956d1050eb3a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Barak Azulay <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches