Skip to content

Commit

Permalink
Merge pull request #30 from jglick/DataSource-field-JENKINS-50001
Browse files Browse the repository at this point in the history
[JENKINS-50001] Do not attempt to serialize a ConnectionPoolDataSource to hudson.scm.IntegritySCM.xml
  • Loading branch information
anuragsen committed Mar 14, 2018
2 parents 9909eba + ce39c29 commit a4d8e61
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/hudson/scm/IntegritySCM.java
Expand Up @@ -899,24 +899,29 @@ public static final class DescriptorImpl extends SCMDescriptor<IntegritySCM>
{
@Extension
public static final DescriptorImpl INTEGRITY_DESCRIPTOR = new DescriptorImpl();
private ConnectionPoolDataSource dataSource;
private transient ConnectionPoolDataSource connectionPoolDataSource;
private List<IntegrityConfigurable> configurations;

public DescriptorImpl()
{
super(IntegritySCM.class, IntegrityWebUI.class);
configurations = new ArrayList<IntegrityConfigurable>();
load();
}

@Override
public void load() {
super.load();

// Initialize our derby environment
System.setProperty(DerbyUtils.DERBY_SYS_HOME_PROPERTY,
Jenkins.getInstance().getRootDir().getAbsolutePath());
DerbyUtils.loadDerbyDriver();
LOGGER.info("Creating Integrity SCM cache db connection...");
dataSource = DerbyUtils
connectionPoolDataSource = DerbyUtils
.createConnectionPoolDataSource(Jenkins.getInstance().getRootDir().getAbsolutePath());
LOGGER.info("Creating Integrity SCM cache registry...");
DerbyUtils.createRegistry(dataSource);
DerbyUtils.createRegistry(connectionPoolDataSource);

// Log the construction...
LOGGER.fine("IntegritySCM DescriptorImpl() constructed!");
Expand Down Expand Up @@ -977,7 +982,7 @@ public boolean isApplicable(@SuppressWarnings("rawtypes") Job project)
*/
public ConnectionPoolDataSource getDataSource()
{
return dataSource;
return connectionPoolDataSource;
}

/**
Expand Down

0 comments on commit a4d8e61

Please sign in to comment.