Package javax.jdo

Examples of javax.jdo.Transaction.begin()


    /** */
    private void runTestRetrieveAllWithCollectionDFGfalse(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Collection coll = new ArrayList();
            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll, false);
View Full Code Here


    /** */
    private void runTestRetrieveAllWithArray(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Object[] objs = new Object[3];
            objs[0] = p1;
            objs[1] = p3;
            objs[2] = rect;
            pm.retrieveAll(objs);
View Full Code Here

    /** */
    private void runTestRetrieveAllWithArrayDFGtrue(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Object[] objs = new Object[3];
            objs[0] = p1;
            objs[1] = p3;
            objs[2] = rect;
            pm.retrieveAll(objs, true);
View Full Code Here

    /** */
    private void runTestRetrieveAllWithArrayDFGfalse(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Object[] objs = new Object[3];
            objs[0] = p1;
            objs[1] = p3;
            objs[2] = rect;
            pm.retrieveAll(objs, false);
View Full Code Here

    /** */
    private void createObjects(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.setRetainValues(false);
            tx.begin();
            p1   = new PCPoint(1,1);
            p1print = p1.toString();
            p2   = new PCPoint(2,2);
            p3   = new PCPoint2(3,3);
            rect = new PCRect(100, p1, p2);
View Full Code Here

     * @return a List including all persistent Employee instances
     */
    protected List getAllEmployees(PersistenceManager pm) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            List allEmployees = (List)pm.newQuery(Employee.class).execute();
            tx.commit();
            return allEmployees;
        } finally {
            if ((tx != null) && tx.isActive()) {
View Full Code Here

  public static SpadgerUser findSpadgerUser(String id) {
    SpadgerUser user = null;
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    try {
      tx.begin();
      user = pm.getObjectById(SpadgerUser.class, id);
    } catch (JDOObjectNotFoundException e) {
      user = new SpadgerUser();
      user.id = id;
      user.email = id;
View Full Code Here

    try{
      pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      Count c = null;
      try{
        tx.begin();
        try{
          c = pm.getObjectById(Count.class, ViewConstants.PRIMARYKEY_ID);
        }catch(Exception e){
          log.log(Level.INFO, "Count 取得中例外", e);
          c = new Count();
View Full Code Here

  public static void deleteAll(Collection objectsToDelete)
  {
    PersistenceManager pm = PMF.get().getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    try {
      tx.begin();
      pm.deletePersistentAll(objectsToDelete);
      tx.commit();
     
      for(Object obj: objectsToDelete)
      {
View Full Code Here

    try{
      pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
      Count c = null;
      try{
        tx.begin();
        try{
          c = pm.getObjectById(Count.class, ViewConstants.PRIMARYKEY_ID);
        }catch(Exception e){
          log.log(Level.INFO, "Count 取得中例外", e);
          c = new Count();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.