Question: I am using Grails 1.3.7, and I have two service, and I call a method of BService in AService as following:

```
BService {
  static boolean transactional = true

  public void bDoThings() {
    //doThings
    b.save()
  }
}

AService {

  static boolean transactional = true

  BService bProxy

  public void aDoThings() {
    //doSomethings
    bProxy.bDoThings()
    //doSomeOtherThings
    throw new RuntimeException()
  }
}

```

I think after throwing RuntimeException, aDoThings will be roll back, and b will not be saved. But only aDotThings is roll back, b is still persisted.

But when I change

```
BService bProxy

```

to

```
BService bService

```

or to

```
def bService

```

Everything works fine.So I wonder why this happens, because I think bProxy is just a variable name, it shouldn't affect the behavior of transaction.
Can anyone explain why?

Answer: 
try this

```
DECLARE @tmp TABLE(field1 VARCHAR(50),field2 VARCHAR(50))
CURSOR START
    INSERT INTO @tmp
        ( field1, field2 )
    SELECT OBJECT, REVENUE

CURSOR END
SELECT * FROM @tmp

```
You'll have to use some kind of table to store the temporary data. If you do not want to use a "real" database table, you can use a [temporary table](http://www.codeproject.com/Articles/42553/Quick-Overview-Temporary-Tables-in-SQL-Server-2005) or a [table variable](http://msdn.microsoft.com/en-us/library/ms175010.aspx).

Those are constructs that, within the procedure, for all intents and purposes, behave like a table, yet are not actual tables in your database.

That said, using cursors to populate a table row-by-row is generally frowned upon in T-SQL, because, for one, cursors can be real performance bottlenecks. Try to see if you can somehow eliminate the use of the cursor completely, if could both speed up and simplify the code.