Skip to main content
replaced http://tridion.stackexchange.com/ with https://tridion.stackexchange.com/
Source Link

Your code looks really familiarfamiliar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method. In this case you will also need to throw Exceptions rather than eating them up.

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method. In this case you will also need to throw Exceptions rather than eating them up.

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method. In this case you will also need to throw Exceptions rather than eating them up.

Clarification
Source Link
Raimond
  • 7.3k
  • 18
  • 29

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method. In this case you will also need to throw Exceptions rather than eating them up.

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method.

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method. In this case you will also need to throw Exceptions rather than eating them up.

Source Link
Raimond
  • 7.3k
  • 18
  • 29

Your code looks really familiar ;) . If super.create() fails, then the super class throws an exception and the entire transaction is rolled back. If you throw an exception in your connectDB method, the entire transaction be rolled back as well. So, instead of doing an e.printStackTrace everywhere, you should throw the exception.

If that doesn't work, have a look at this Storage Extension code, which essentially does the same as you are trying to do, but it instead calls the 'extra' action inside the commitTransaction() method after the super method has committed.

Another, and maybe simpler, alternative is to first call your updateDB method and then the super.create() method.