Skip to content

Commit

Permalink
Fixes with new lib versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dchenbecker committed Nov 3, 2016
1 parent 595459c commit e4ff62f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Expand Up @@ -13,7 +13,7 @@ and that you license the work to the ScalaJPA project under the project's

# License

Copyright © 2008-2010 Derek Chen-Becker
Copyright © 2008-2016 Derek Chen-Becker

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,4 +25,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
and limitations under the License.
13 changes: 5 additions & 8 deletions src/main/scala/org/scala_libs/jpa/JndiEM.scala
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2009 Derek Chen-Becker
* Copyright 2008-2016 Derek Chen-Becker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,13 +82,10 @@ class JndiEMF(val jndiName : String) extends ScalaEMFactory {
def closeEM (em : EntityManager) = {
/* We only want to commit if we haven't already thrown an exception (due to a constraint violation, etc)
*/
try {
if (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
tx.rollback()
} else if (tx.getStatus() == Status.STATUS_ACTIVE) {
tx.commit()
} else {
}
if (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
tx.rollback()
} else if (tx.getStatus() == Status.STATUS_ACTIVE) {
tx.commit()
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/test/scala/org/scala_libs/jpa/test/ScalaJPASpecs.scala
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011 Derek Chen-Becker
* Copyright 2008-2016 Derek Chen-Becker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,8 +25,9 @@ import org.specs2.mutable.Specification
object ThreadEM extends LocalEMF("test") with ThreadLocalEM

class ScalaJPASpecs extends Specification {
sequential

"The 'test' LocalEMF instance" should {
sequential
val myInstance = new MyItem
myInstance.id = 42
myInstance.name = "Fred"
Expand Down

0 comments on commit e4ff62f

Please sign in to comment.