Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorkmoore2008-09-10 15:07:08 +0000
committerkmoore2008-09-10 15:07:08 +0000
commitd71ae87317aa86797e6356314a86fda43beff4e1 (patch)
tree02ec281ce0dfde68c2bd83a95120b792967ec7eb /jpa
parentae035a8d903f70821762647771d4d49afe82c100 (diff)
downloadwebtools.dali-d71ae87317aa86797e6356314a86fda43beff4e1.tar.gz
webtools.dali-d71ae87317aa86797e6356314a86fda43beff4e1.tar.xz
webtools.dali-d71ae87317aa86797e6356314a86fda43beff4e1.zip
workaround for DTP bug 246270 - build the connection profile (thus loading DTP profiles) before adding the connection profile listener
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
index 648192ffee..441f7a9624 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
@@ -54,13 +54,19 @@ public class GenericJpaDataSource
public GenericJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
super(jpaProject);
+ //moving the building of the connection profile before the connectionProfileListener
+ //is added. Need to make sure the loading of db profiles is completed before
+ //listening, otherwise we get notifications before our model is finished being built.
+ //this means our updater is called before it is set which results in an IllegalStateException.
+ //Hopefully this change is temporary and DTP will fix bug 246270 where I suggest they
+ //not fire events when building profiles.
+ this.connectionProfileName = connectionProfileName;
+ this.connectionProfile = this.buildConnectionProfile(connectionProfileName);
this.connectionProfileListener = this.buildConnectionProfileListener();
this.getConnectionProfileFactory().addConnectionProfileListener(this.connectionProfileListener);
this.connectionListener = this.buildConnectionListener();
- this.connectionProfileName = connectionProfileName;
- this.connectionProfile = this.buildConnectionProfile(connectionProfileName);
if (this.connectionProfile != null) {
this.connectionProfile.addConnectionListener(this.connectionListener);
}

Back to the top