Skip to content

Commit 841c9bd

Browse files
committed
fixing statup migrations
1 parent a88d782 commit 841c9bd

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.faction</groupId>
44
<artifactId>faction</artifactId>
5-
<version>1.7.1-SNAPSHOT</version>
5+
<version>1.7.0-SNAPSHOT</version>
66
<packaging>war</packaging>
77
<name>Faction</name>
88
<scm>

release.properties

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#release configuration
2+
#Sun Oct 26 22:18:18 CDT 2025
3+
projectVersionPolicyId=default
4+
scm.branchCommitComment=@{prefix} prepare branch @{releaseLabel}
5+
project.scm.org.faction\:faction.tag=1.7.0
6+
pinExternals=false
7+
projectVersionPolicyConfig=<projectVersionPolicyConfig>${projectVersionPolicyConfig}</projectVersionPolicyConfig>\n
8+
exec.activateProfiles=github
9+
pushChanges=true
10+
scm.rollbackCommitComment=@{prefix} rollback the release of @{releaseLabel}
11+
remoteTagging=true
12+
scm.commentPrefix=[maven-release-plugin]
13+
releaseStrategyId=default
14+
project.scm.org.faction\:faction.connection=scm\:git\:https\://github.com/factionsecurity/faction.git
15+
completedPhase=check-poms
16+
scm.url=scm\:git\:https\://github.com/factionsecurity/faction.git
17+
scm.developmentCommitComment=@{prefix} prepare for next development iteration
18+
scm.id=faction-web
19+
exec.additionalArguments=-Dmaven.javadoc.skip\=true -Dmaven.test.skipTests\=true -Dmaven.test.skip\=true
20+
scm.tagNameFormat=@{project.version}
21+
exec.snapshotReleasePluginAllowed=false
22+
project.scm.org.faction\:faction.url=https\://github.com/factionsecurity/faction.git
23+
scm.username=summitt
24+
preparationGoals=clean verify
25+
project.scm.org.faction\:faction.developerConnection=scm\:git\:https\://github.com/factionsecurity/faction.git
26+
scm.releaseCommitComment=@{prefix} prepare release @{releaseLabel}
27+
exec.pomFileName=pom.xml

src/com/fuse/actions/bootstrap/AppBootstrapListener.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,19 @@ private void fixAssessmentStatuses() {
5151
if (!assessmentsToFix.isEmpty()) {
5252
System.out.println("Found " + assessmentsToFix.size() + " assessments to fix");
5353

54-
HibHelper.getInstance().preJoin();
55-
em.joinTransaction();
54+
// Begin transaction using EntityManager's built-in transaction management
55+
em.getTransaction().begin();
5656

5757
for (Assessment assessment : assessmentsToFix) {
5858
assessment.setStatus("Completed");
59-
em.persist(assessment);
59+
em.merge(assessment); // Use merge instead of persist for existing entities
6060
System.out.println("Fixed assessment ID " + assessment.getId() +
6161
" - changed status from Open to Completed (completed date: " +
6262
assessment.getCompleted() + ")");
6363
}
6464

65-
HibHelper.getInstance().commit();
65+
// Commit the transaction
66+
em.getTransaction().commit();
6667
System.out.println("Assessment status migration completed successfully");
6768
} else {
6869
System.out.println("No assessments found requiring status fix");
@@ -71,7 +72,7 @@ private void fixAssessmentStatuses() {
7172
} catch (Exception e) {
7273
System.err.println("Error fixing assessment statuses: " + e.getMessage());
7374
e.printStackTrace();
74-
if (em != null && em.getTransaction().isActive()) {
75+
if (em != null && em.getTransaction() != null && em.getTransaction().isActive()) {
7576
em.getTransaction().rollback();
7677
}
7778
} finally {

0 commit comments

Comments
 (0)