Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
4b1daefe
Commit
4b1daefe
authored
Jun 15, 2020
by
Piotr Gawron
Browse files
when caching make sure we have new db session
parent
1aba71f5
Pipeline
#28228
failed with stage
in 11 minutes and 5 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
4b1daefe
...
...
@@ -25,8 +25,10 @@ minerva (15.0.0~beta.5) unstable; urgency=medium
notes
(#
1287
)
*
Bug
fix
:
import
from
GPML
introduces
space
between
inhibition
and
process
(#
1270
)
*
Bug
fix
:
map
c
a
ntaining
kinetic
equations
exported
to
CellDesigner
was
not
*
Bug
fix
:
map
c
o
ntaining
kinetic
equations
exported
to
CellDesigner
was
not
a
valid
SBML
file
(#
1271
)
*
Bug
fix
:
search
for
drugs
for
in
target
element
in
submap
did
not
work
after
uploading
map
(#
1285
,
#
1288
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Tue
,
2
Jun
2020
16
:
00
:
00
+
0200
...
...
service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java
View file @
4b1daefe
...
...
@@ -389,7 +389,6 @@ public class ProjectService implements IProjectService {
}
logger
.
info
(
"Project "
+
project
.
getProjectId
()
+
" created successfully."
);
modelService
.
getLastModelByProjectId
(
project
.
getProjectId
());
}
catch
(
PersistenceException
e
)
{
outOfMemoryBuffer
=
null
;
logger
.
error
(
"Problem with database"
,
e
);
...
...
@@ -420,6 +419,19 @@ public class ProjectService implements IProjectService {
problems
.
add
(
t
);
waitForInitialData
.
countDown
();
}
try
{
if
(
params
.
isAsync
())
{
// because we are running this in separate thread we need to open a
// new session for db connection
dbUtils
.
createSessionForCurrentThread
();
}
modelService
.
getLastModelByProjectId
(
params
.
getProjectId
());
}
finally
{
if
(
params
.
isAsync
())
{
// close the transaction for this thread
dbUtils
.
closeSessionForCurrentThread
();
}
}
}
});
...
...
web/src/test/java/lcsb/mapviewer/web/ControllerIntegrationTest.java
View file @
4b1daefe
...
...
@@ -243,6 +243,7 @@ abstract public class ControllerIntegrationTest {
submap
.
setTileSize
(
256
);
submap
.
setWidth
(
100
);
submap
.
setHeight
(
100
);
submap
.
addElement
(
createProtein
());
ModelSubmodelConnection
submodelConnection
=
new
ModelSubmodelConnection
(
submap
,
SubmodelType
.
UNKNOWN
);
map
.
addSubmodel
(
submodelConnection
);
...
...
@@ -253,8 +254,10 @@ abstract public class ControllerIntegrationTest {
return
project
;
}
int
counter
=
1
;
private
GenericProtein
createProtein
()
{
GenericProtein
element
=
new
GenericProtein
(
"p
1
"
);
GenericProtein
element
=
new
GenericProtein
(
"p"
+(
counter
++)
);
element
.
setWidth
(
100.0
);
element
.
setHeight
(
20.0
);
element
.
setX
(
10
);
...
...
web/src/test/java/lcsb/mapviewer/web/DrugControllerIntegrationTest.java
View file @
4b1daefe
...
...
@@ -16,6 +16,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
org.springframework.test.web.servlet.RequestBuilder
;
import
org.springframework.transaction.annotation.Transactional
;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.user.ConfigurationElementType
;
import
lcsb.mapviewer.services.interfaces.IConfigurationService
;
...
...
@@ -74,6 +75,20 @@ public class DrugControllerIntegrationTest extends ControllerIntegrationTest {
.
andExpect
(
status
().
isNotFound
());
}
@Test
public
void
testSearchDrugsByTargetInSubmap
()
throws
Exception
{
Project
project
=
createProject
(
"test"
);
MockHttpSession
session
=
createSession
(
BUILT_IN_TEST_ADMIN_LOGIN
,
BUILT_IN_TEST_ADMIN_PASSWORD
);
int
submapId
=
project
.
getModels
().
iterator
().
next
().
getSubmodels
().
iterator
().
next
().
getSubmodel
().
getElements
()
.
iterator
().
next
().
getId
();
RequestBuilder
request
=
get
(
"/projects/"
+
project
.
getProjectId
()
+
"/drugs:search?target=ALIAS:"
+
submapId
)
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
());
}
@Test
public
void
testGetSuggestedList
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
TEST_ADMIN_LOGIN
,
TEST_ADMIN_PASSWORD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment